question

Håkan Winther avatar image
Håkan Winther asked

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][1] 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] [1]: http://support.microsoft.com/kb/981037 [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
sql-server-2008mergeexceptionconnect-item
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Håkan Winther avatar image
Håkan Winther answered
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
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robbin avatar image robbin commented ·
Thanks for the info.
0 Likes 0 ·
Blackhawk-17 avatar image Blackhawk-17 commented ·
You do find interesting issues Håkan :)
0 Likes 0 ·
Håkan Winther avatar image Håkan Winther commented ·
@blackhawk-17 sometimes, and I have to create a connect item for this issue.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.