sql-serverazureazure-data-sync

Azure SQL Database SYNC column does not allow nulls warning


I have a Microsoft SQL Data Sync Agent job set up to sync our local server to Azure. It was working great, then we made a few updates locally and it didn't remove the deleted rows from Azure, and now the sync fails with a warning:

Sync completed with warnings in 708.02 seconds. 
Upload:   4646 changes applied/155 failed   
Download: 680 changes applied/0 failedData Sync will stop synchronizing changes for this sync group member in -60 days if the failures are not resolved.    
Upload - errors for first 5 rows that failed to apply:Error #1: SqlException Error Code: -2146232060 - 
SqlError Number:515, Message: Cannot insert the value NULL into column 'ModelID', table 'dbo.ModelYears'; column does not allow nulls. INSERT fails. 
SqlError Number:3621, Message: The statement has been terminated. Error #2: SqlException Error Code: -2146232060 - 
SqlError Number:515, Message: Cannot insert the value NULL into column 'ModelID', table 'dbo.ModelYears'; column does not allow nulls. INSERT fails. 
SqlError Number:3621, Message: The statement has been terminated. Error #3: SqlException Error Code: -2146232060 - 
SqlError Number:515, Message: Cannot insert the value NULL into column 'ModelID', table 'dbo.ModelYears'; column does not allow nulls. INSERT fails. 
SqlError Number:3621, Message: The statement has been terminated. Error #4: SqlException Error Code: -2146232060 - 
SqlError Number:515, Message: Cannot insert the value NULL into column 'ModelID', table 'dbo.ModelYears'; column does not allow nulls. INSERT fails. 
SqlError Number:3621, Message: The statement has been terminated. Error #5: SqlException Error Code: -2146232060 - 
SqlError Number:515, Message: Cannot insert the value NULL into column 'ModelID', table 'dbo.ModelYears'; column does not allow nulls. INSERT fails. 
SqlError Number:3621, Message: The statement has been terminated.     
For more information, provide tracing ID ‘92002a08-b374-4579-b58c-a5164e820767’ to customer support.

The ModelID column does not allow nulls on either table, so I'm not sure what is causing the error.

I truncated ModelYears_dss_tracking and ModelYears on Azure as one forum suggested, and it did repopulate the tables, but it's still throwing the warnings.


Solution

  • Could you please confirm that whether you have changed PK of this table?

    A quick way to dismiss the error is to 1) delete the sync group 2) delete all tables and SP under the schema 'DataSync' on both hub and member 3) delete triggers contain the word 'dss' 4) create sync group again

    Regards, Gary