SQL Compare

Latest version: 10.0

SQL Compare

Knowledge Base

Column does not allow nulls. INSERT fails

Category: Troubleshooting & error messages
Date: 08 Jun 2009
Product: SQL Compare
The following error may be returned by SQL Server when synchronizing the schema of two databases:

Error: Error Comparing DB1 vs DB2 : Cannot insert the value NULL into column 'YourColumn', table
'database.dbo.tmp_rg_xx_MyTable'; column does not allow nulls.
INSERT fails.

This error will occur if you are adding a new column to an already-populated table and the new column does not allow null values.

The only way to get around this situation is to assign a default value to the column in the source database. Alternatively, set the column to allow nulls for the purposes of the synchronisation and then set it back after you have the correct data inserted.

Document ID: KB200906000401 Keywords: SQL,Compare,NULL,insert,allow,fails

Was this article helpful?

Search support
Forums
Visit the SQL Compare forum.

SQL Compare

all SQL products

all products