x

Attempting to set a non-NULL-able column's value to NULL

In SQL server 2008 sp3, I have an issue with merge and it is reported as a connect item for SQL server 2008 sp1 and there is a fix in CU7 at: http://support.microsoft.com/kb/981037

The exception I get is : "Attempting to set a non-NULL-able column's value to NULL"

There are no NULL values in my source recordset. If I disable the foreign keys or populate the table with a lot more data, everything works fine. Does anyone of you experience the same issue?

Here is one of the connect items and it seems like the issue still exists in SP2: [http://connect.microsoft.com/SQLServer/feedback/details/532561/attempting-to-set-a-non-null-able-columns-value-to-null-on-sql-2008-sp1-and-2008-r2-ctp][2]

[2]: http://connect.microsoft.com/SQLServer/feedback/details/532561/attempting-to-set-a-non-null-able-columns-value-to-null-on-sql-2008-sp1-and-2008-r2-ctp
more ▼

asked May 16, 2012 at 07:48 AM in Default

Håkan Winther gravatar image

Håkan Winther
15.6k 35 37 48

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

By deleting an index with columns that already was covered by another nonclustered index, I got a new execution plan without any table spool, and according the support item the table spool is causing the issue. :(

I would say that the issue that was supposed to be fixed in CU7 is still existing in SP3

You can read more about it at our blog: [http://www.sqlservice.se/sv/start/blogg/merge-issue-attempting-to-set-a-nonnullable-column-s-value-to-null.aspx][1]

[1]: http://www.sqlservice.se/sv/start/blogg/merge-issue-attempting-to-set-a-nonnullable-column-s-value-to-null.aspx
more ▼

answered May 16, 2012 at 08:20 AM

Håkan Winther gravatar image

Håkan Winther
15.6k 35 37 48

Thanks for the info.
May 16, 2012 at 10:58 AM robbin
You do find interesting issues Håkan :)
May 16, 2012 at 07:29 PM Blackhawk-17
@blackhawk-17 sometimes, and I have to create a connect item for this issue.
May 21, 2012 at 08:59 AM Håkan Winther
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1838
x48
x7
x1

asked: May 16, 2012 at 07:48 AM

Seen: 1869 times

Last Updated: May 21, 2012 at 08:59 AM