Home column name or number ... not match table definition in table created by create script.Error displayed while inserting rows from one table to another
Reply: 0

column name or number ... not match table definition in table created by create script.Error displayed while inserting rows from one table to another

user1149
1#
user1149 Published in June 19, 2018, 6:15 pm

I have two identical tables in different server instances. One server is production and the other one is for testing. The testing tables where created by using scripts created by SQL management studio (Right click on table -->script table as --> Create). To move test data i am using a linked server and the following code :

set identity_insert <Server>.<DB>.<schema>.<SomeID> ON
insert into <Server>.<DB>.<schema>.<TestTb>
select top 100 * from <Server>.<DB>.<schema>.<ProdTB>
set identity_insert <Server>.<DB>.<schema>.<SomeID> OFF

The above worked for a couple of the tables i created. In the last one, i get the "column name or number of supplied values does not match table definition in table created by create script" error.i have checked the Columns collation and everything is ok.

The only difference i have is that i haven't created all the indexes found in the Production env, but i don't really think this causes the error.

I' m working on Sql server 2008.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.343962 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO