MERGE statement treats non-nullable computed columns incorrectly in some scenarios
When executing a MERGE statement where the WHEN NOT MATCHED THEN INSERT branch is exercised, if the target table has a clustered index on an attribute that is not of the ON... clause, and that attribute is being updated, and there is a non-NULLable computed column, an error will incorrectly be raised that you cannot insert the value NULL for that computed column.
Upvotes: 3<=-=Aug 27 2010 12:33PM=-=>
Thanks for reporting the issue. I can reproduce the issue in SQL Server 2008. We will investigate the issue and let you know what we find.
Umachandar, SQL Programmability Team
This issue will be fixed in the next major release of SQL Server.
Eugene Zabokritski, SQL Engine team.
Confirmed to still be a bug in SQL 2008 (SP3) build 5869 (X64), as expected.
Confirmed to still be a bug in SQL 2008 R2 build 4321 (X64).
Confirmed to be FIXED in SQL 2012 build 5522 (X64)
Confirmed to be FIXED in SQL 2014 build 2480 (X64)