Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

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.

0 votes
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)

We’ll send you updates on this idea

AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Upvotes: 3

<=-=Aug 27 2010 12:33PM=-=>

Hi,
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

<=-=Sep 8 2010 5:33PM=-=>

This issue will be fixed in the next major release of SQL Server.
Eugene Zabokritski, SQL Engine team.

<=-=Apr 24 2015 8:39AM=-=>

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)

0 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base