Column name or number of supplied values does not match
37stars
Posts: 10
We are using the SQL Source Control product to keep our database schemas in Team Foundation Server. Every night an automated process builds the main project and deploys to our test environment. Part of that process is to automatically update the test database using SQLCompare. This has been running perfectly for the last month.
Yesterday we started getting this error message:
Column name or number of supplied values does not match table definition
What does this error message mean and where would I start to resolve the problem?
The full command line we are using plus the output is below:
"C:\Program Files (x86)\Red Gate\SQL Compare 8\sqlcompare" /scr1:"C:\Builds\1\Project\Nightly Build\Sources\Project.DataLayer\Database" /s2:192.168.114.14 /db2:Database /UserName2:user /p2:pw /o:Default /Report:"C:\Builds\1\Project\Nightly Build\SchemaDiffReport.html" /ReportType:Interactive /ScriptFile:"C:\Builds\1\Project\Nightly Build\SchemaSyncScript.sql" /sync /force
SQL Compare Command Line V8.50.12.18
==============================================================================
Copyright c Red Gate Software Ltd 1999-2010
Serial Number: xxxxxxxxxxxxxxxxxxx
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Creating SQL
Synchronizing databases (from DB1 to DB2)
Error: Synchronization of 'Scripts.Database' and
'192.168.114.14.Database' failed: Column name or number of supplied
values does not match table definition.
Yesterday we started getting this error message:
Column name or number of supplied values does not match table definition
What does this error message mean and where would I start to resolve the problem?
The full command line we are using plus the output is below:
"C:\Program Files (x86)\Red Gate\SQL Compare 8\sqlcompare" /scr1:"C:\Builds\1\Project\Nightly Build\Sources\Project.DataLayer\Database" /s2:192.168.114.14 /db2:Database /UserName2:user /p2:pw /o:Default /Report:"C:\Builds\1\Project\Nightly Build\SchemaDiffReport.html" /ReportType:Interactive /ScriptFile:"C:\Builds\1\Project\Nightly Build\SchemaSyncScript.sql" /sync /force
SQL Compare Command Line V8.50.12.18
==============================================================================
Copyright c Red Gate Software Ltd 1999-2010
Serial Number: xxxxxxxxxxxxxxxxxxx
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Creating SQL
Synchronizing databases (from DB1 to DB2)
Error: Synchronization of 'Scripts.Database' and
'192.168.114.14.Database' failed: Column name or number of supplied
values does not match table definition.
Comments
Thanks for your post. We have seen this happen before when a sproc or something else is generating inserts into a table that doesn't have the correct amount of columns or doesn't contain the column being referenced in the sproc.
There's a couple of articles I've linked to below which contain some more info on this error:
http://www.sql-server-performance.com/f ... ch_p1.aspx
http://www.sql-server-helper.com/error- ... g-213.aspx
You may however wish to take a look at SQL Prompt 5 as this will show you invalid objects in your DB, and should hopefully point you to the particular object that is referencing additional columns or is wrong in someway.
HTH!
Pete
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569