Failure Creating schema objects in database "x" Column name or number of supplied values does not match table definition.

Feb 22, 2012 at 10:27 AM

I've recently updated to the DAC Import Export Client-side Tools V 1.4 (Ensuring all the required assemblies were up to date as well) and I get the following error whenever I try to import a bacpac I've exported from SQL Azure onto an SQL Server 2008 instance we have locally:

CreateDatabaseObjects: Failure Creating schema objects in database 'XXXXXXXXX20120221' System.Data.SqlClient.SqlException (0x80131904): Column name or number of supplied values does not match table definition.

I've tried this on a few exports of our database to no avail.  Is this an issue we can fix with our schema or is there an issue with the client tools?  If it's our schema what would be the easiest way to identify the table(s) causing the above issue?

Original command used:

F:\Databases\Backups\DacCli.exe -s XXXX\DEVELOPMENT -d XXXXXXXXX20120221 -e -f F:\Databases\Backups\XXXXXXXXX20120221_2000.bac

Full Stack trace:

Import started: 22/02/2012 11:14:35
Connecting to XXXX\DEVELOPMENT...
Connection Open.
[11:15:22] PrepareSystemTables: Pending Preparing DAC metadata in the SQL Server instance 'XXXX\DEVELOPMENT'
[11:15:22] PrepareSystemTables: Success Preparing DAC metadata in the SQL Server instance 'XXXX\DEVELOPMENT'
[11:15:24] CreateDatabase: Pending Creating database 'XXXXXXXXX20120221' [11:15:26] CreateDatabase: Success Creating database 'XXXXXXXXX20120221' [11:15:26] ScriptDACObjects: Pending Preparing deployment script
[11:15:42] ScriptDACObjects: Success Preparing deployment script
[11:15:42] CreateDatabaseObjects: Pending Creating schema objects in database 'XXXXXXXXX20120221'
[11:15:43] CreateDatabaseObjects: Failure Creating schema objects in database 'XXXXXXXXX20120221' System.Data.SqlClient.SqlException (0x80131904): Col umn name or number of supplied values does not match table definition. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHa ndler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.SqlServer.Management.Dac.Core.ConnectionManager.RetryPolicy`1.ExecuteAction[R](Func`1 func) at Microsoft.SqlServer.Management.Dac.Core.ConnectionManager.SingleDatabaseModeConnectionManager.ExecutionContext.ExecuteNonQueryWithRetry(SqlComma nd sqlCommand, RetryPolicy commandRetryPolicy, RetryPolicy connectionRetryPolicy) at Microsoft.SqlServer.Management.Dac.Core.ConnectionManager.SingleDatabaseModeConnectionManager.ExecutionContext.ExecuteNonQuery(String sqlString) at Microsoft.SqlServer.Management.Dac.Core.SqlScriptExecutionAction.Execute() at Microsoft.SqlServer.Management.Dac.Core.SqlScriptExecutionAction.Execute(IExecutionContext executionContext, TransactionalActionManager transact ionalActionManager, IEnumerable`1 actionGroups, ScriptTarget scriptTarget, Boolean rollbackOnFailure, Boolean sendEvents, DatabaseConfigurationPropert ies configurationProperties) at Microsoft.SqlServer.Management.Dac.Core.CreateDatabaseObjectsStep.Execute() at Microsoft.SqlServer.Management.Dac.Core.TransactionalActionManager.ManagedActionStep.TransactionalStep.DoExecute() at Microsoft.SqlServer.Management.Dac.Core.TransactionalActionManager.ManagedActionStep.Execute()
[11:15:43] CreateDatabase: RollbackPending Creating database 'XXXXXXXXX20120221'
[11:15:43] CreateDatabase: RollbackSuccess Creating database 'XXXXXXXXX20120221' DAC Exception: Microsoft.SqlServer.Management.Dac.DacException: 50001: Unable to import bacpac. Inner exception may have more details. ---> Microsoft. SqlServer.Management.Dac.Core.DacException: 50001: Unable to import bacpac. Inner exception may have more details. ---> System.Data.SqlClient.SqlExcep tion: Column name or number of supplied values does not match table definition. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHa ndler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.SqlServer.Management.Dac.Core.ConnectionManager.RetryPolicy`1.ExecuteAction[R](Func`1 func) at Microsoft.SqlServer.Management.Dac.Core.ConnectionManager.SingleDatabaseModeConnectionManager.ExecutionContext.ExecuteNonQueryWithRetry(SqlComma nd sqlCommand, RetryPolicy commandRetryPolicy, RetryPolicy connectionRetryPolicy) at Microsoft.SqlServer.Management.Dac.Core.ConnectionManager.SingleDatabaseModeConnectionManager.ExecutionContext.ExecuteNonQuery(String sqlString) at Microsoft.SqlServer.Management.Dac.Core.SqlScriptExecutionAction.Execute() at Microsoft.SqlServer.Management.Dac.Core.SqlScriptExecutionAction.Execute(IExecutionContext executionContext, TransactionalActionManager transact ionalActionManager, IEnumerable`1 actionGroups, ScriptTarget scriptTarget, Boolean rollbackOnFailure, Boolean sendEvents, DatabaseConfigurationPropert ies configurationProperties) at Microsoft.SqlServer.Management.Dac.Core.CreateDatabaseObjectsStep.Execute() at Microsoft.SqlServer.Management.Dac.Core.TransactionalActionManager.ManagedActionStep.TransactionalStep.DoExecute() at Microsoft.SqlServer.Management.Dac.Core.TransactionalActionManager.ManagedActionStep.Execute() at Microsoft.SqlServer.Management.Dac.Core.TransactionalActionManager.ExecuteActionSteps(IEnumerable`1 managedActionSteps) at Microsoft.SqlServer.Management.Dac.Core.TransactionalActionManager.Execute() at Microsoft.SqlServer.Management.Dac.Core.DacStore.Import(Stream stream, DatabaseDeploymentProperties deploymentProperties, Boolean skipPolicyVali dation) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Dac.Core.DacStore.Import(Stream stream, DatabaseDeploymentProperties deploymentProperties, Boolean skipPolicyVali dation) at Microsoft.SqlServer.Management.Dac.DacStore.Import(Stream stream, DatabaseDeploymentProperties deploymentProperties, Boolean skipPolicyValidatio n) --- End of inner exception stack trace --- at Microsoft.SqlServer.Management.Dac.DacStore.Import(Stream stream, DatabaseDeploymentProperties deploymentProperties, Boolean skipPolicyValidatio n) at Microsoft.SqlServer.Management.Dac.DacStore.Import(String path, DatabaseDeploymentProperties deploymentProperties, Boolean skipPolicyValidation) at DacImportExportCli.Program.ImportAction()
Import Complete.
Total time: 00:01:07.9951423

Mar 6, 2012 at 11:37 AM

Resolved by Preetha; it was a stored procedure in the database inserting too few values into a table; thus causing the error when it was being recreated