Azure SQL Data Sync - Cannot insert the value NULL into column

Patrik Höiem-Flyckt 21 Reputation points
2023-01-11T14:07:02.19+00:00

I am just trying to test that the sync is working - I changed one column in one row using Management Studio directly in column. Not the column that it complains about. After that I have tried to stop and restart it, but it is still faulty with this fault:

"Sync failed with the exception "An unexpected error occurred when applying batch file sync_b606b293f28d49878207963022418e20c749a20b879847ce9ace441103a3007e\31101e8c-1a67-4bb2-9ce9-5ce75f9f58ff.batch. See the inner exception for more details.Inner exception: Failed to execute the command 'BulkUpdateCommand' for table 'dbo.PROJEKT'; the transaction was rolled back. Ensure that the command syntax is correct.Inner exception: SqlException Error Code: -2146232060 - SqlError Number:515, Message: Cannot insert the value NULL into column 'PROJEKT_NR', table 'rbpub.dbo.PROJEKTLOG'; column does not allow nulls. INSERT fails. SqlError Number:3621, Message: The statement has been terminated. For more information, provide tracing ID ‘7c7458a3-33d2-4fc0-839c-b1b19d2ddad6’ to customer support."

Any suggestions on how to go on. I have no control over what is happening "under the hood".

Azure SQL Database
{count} votes

3 answers

Sort by: Most helpful
  1. Patrik Höiem-Flyckt 21 Reputation points
    2023-01-11T14:17:59.23+00:00

    Ok, that might have been a little bit premature. I saw now that the problem was with another table PROJEKTLOG - am currently investigating if there are any new, badly written triggers or anything else that might be the root cause.

    0 comments No comments

  2. Patrik Höiem-Flyckt 21 Reputation points
    2023-01-11T14:33:42.8166667+00:00

    Problem was a trigger that will have to be rewritten - please remove this question

    0 comments No comments

  3. GeethaThatipatri-MSFT 29,502 Reputation points Microsoft Employee
    2023-01-12T17:57:49.66+00:00

    Hi, [@Patrik Höiem-Flyckt ] Thanks for posting your question in the Microsoft Q&A forum.

    Data sync does not support schema change. When you make any schema change, you have to

    1. Refresh the schema
    2. remove that table.
    3. add it back so that data sync will know the new schema.

    Hope this will help. Please let us know if any further queries.

    Regards

    Geetha

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.