dbTalk Databases Forums  

tembdb is not accepting the default null value

comp.databases.sybase comp.databases.sybase


Discuss tembdb is not accepting the default null value in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Venky
 
Posts: n/a

Default tembdb is not accepting the default null value - 12-04-2008 , 09:46 AM






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

Reply With Quote
  #2  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM







"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #3  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #4  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #5  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #6  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #7  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #8  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #9  
Old   
Carl Kayser
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 10:26 AM




"Venky" <mca.venkateswaran (AT) gmail (DOT) com> wrote

Quote:
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?




Reply With Quote
  #10  
Old   
Venky
 
Posts: n/a

Default Re: tembdb is not accepting the default null value - 12-04-2008 , 09:55 PM



On Dec 4, 9:26*pm, "Carl Kayser" <kayse... (AT) bls (DOT) gov> wrote:
Quote:
"Venky" <mca.venkateswa... (AT) gmail (DOT) com> wrote in message

news:d8004ccd-8a23-47a5-97be-e3fe99ab87d2 (AT) z6g2000pre (DOT) googlegroups.com...





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...


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.