Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Copying Tables - Columns Do Not Match

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2014-07-31 : 13:40:23
hi all,
When populating tables, within a stored procedure, is there any way
of over-riding the error below, to enable the table to be copied anyway? I have a lot of source tables that contain more columns (at the end of the row) than the destination table has.
When this is ran inside a job, the job fails.

Msg 213, Level 16, State 1, Line 1
Column name or number of supplied values does not match table definition.

Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-07-31 : 13:49:39
You can't override it. You need to list out the columns instead of using *.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2014-07-31 : 16:41:15
Thanks Tara. Yes, I knew the fix, was just hoping for a less painful alternative :--)
Go to Top of Page
   

- Advertisement -