x
login about faq Site discussion (meta-askssc)

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

more ▼

asked May 16 '12 at 07:48 AM in Default

Håkan Winther gravatar image

Håkan Winther
15k 29 35 46

(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

more ▼

answered May 16 '12 at 08:20 AM

Håkan Winther gravatar image

Håkan Winther
15k 29 35 46

Thanks for the info.

May 16 '12 at 10:58 AM robbin

You do find interesting issues Håkan :)

May 16 '12 at 07:29 PM Blackhawk-17

@blackhawk-17 sometimes, and I have to create a connect item for this issue.

May 21 '12 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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1602
x40
x6
x1

asked: May 16 '12 at 07:48 AM

Seen: 808 times

Last Updated: May 21 '12 at 08:59 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.