Error shows wrong table name

Mike_K123 used Ask the Experts™
I am getting an error when attempting to update  records in a SQL table with records from a second SQL table on the same server and the same DB.


" Cannot insert the value NULL into column 'AColumnName', table 'My_Table'; column does not allow nulls. INSERT failed"

The table name shown in the error is not the table I am trying to update. Can someone help me understand why I am seeing a totally different table name in the error?

This is on a SQL Server 2016. The code I am using works on a SQL Server 2008.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior DBA
Most Valuable Expert 2018
Top Expert 2014
There's likely a trigger(s) on the table you are inserting to that attempts to modify other table(s).


Thank you. I needed to disable the trigger to complete the update.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial