![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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 |
#9
| |||
| |||
|
|
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 |
#10
| |||
| |||
|
|
"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 - |
![]() |
| Thread Tools | |
| Display Modes | |
| |