"Venky" wrote in message
On Dec 4, 9:26 pm, "Carl Kayser" wrote:
> "Venky" wrote in message
>
>
>
>
>
>
>
> >I have written a procedure
> > Ex:
> > create table #temp1
> > (
> > field1 varchar(10) null
> > )
>
> > insert into #temp1 select 'venkt'
>
> > create table #temp2
> > (
> > field1 varchar(10) null,
> > field2 varchar(10) null
> > )
>
> > insert into #temp2 select * from #temp1
>
> > This above procedure is working in one server. tempdb automatically
> > inserting null value into field2 of #temp2.
> > But in another server the procedure is giving the below error message.
> > Insert error: column name or number of supplied values does not match
> > table definition
>
> > I have fixed this issue by below code
> > insert into #temp2 select * from #temp1
> > instead of this one i have used
> > insert into #temp2 select *,null from #temp1
>
> > Can you please someone explain why tempdb is giving this error.
>
> > Thanks,
> > Venky
>
> Not that it really makes a lot of sense to me (since I think that the
> first
> successful insert is wrong) but has "allow nulls by default" been set for
> model (and implicitly tempdb) on one server and not the other?- Hide
> quoted text -
>
> - Show quoted text -
Yes. you are correct.
how can we check the tempdb model details. Can you please provide me
the command...
sp_helpdb tempdb
go
>> Stay informed about: tembdb is not accepting the default null value