question

red68 avatar image
red68 asked

Update Query not setting all values = NULL

I have a user who runs the following update statement. Update Table Set Segment = NULL If he runs a select distinct segment query, he still has some segments with values in them but not all. I can run the same query and my "select distinct segment" displays NULL after I run the update statement. Any one ever run into this issue? Thanks!
sql-server-2012
5 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.

Do both connections have the same ANSI NULL handling policy? Check your [SESSIONPROPERTIES][1] [1]: https://msdn.microsoft.com/en-us/library/ms175001.aspx
1 Like 1 ·
Trigger on the table differentiating between the user and you?
0 Likes 0 ·
Yes, both connections returned value of "1" for ANSI NULL SESSIONPROPERTIES. No, we don't use triggers at all. Thx
0 Likes 0 ·
How long after running the UPDATE statement are you running the SELECT statement to test it? I would guess that another program is updating the values after your user does. That is the problem we had once. Try using this instead to check what is being updated: UPDATE Table SET Segment = NULL OUTPUT DELETED.*, INSERTED.*
0 Likes 0 ·
Any error messages when the user runs the update? In fact any messages at all? Including 'rows affected'
0 Likes 0 ·

0 Answers

·

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.