In microsoft SQL, I have the following statement (roughly):
UPDATE sometable
SET somecolumn = @somevalue
WHERE somecolumn = NULL;
@somevalue
is set previously in the script.
This runs fine and SQL tells me zero rows are affected. There are five rows were somecolumn is NULL. What am I doing wrong?
You have to use IS NULL instead to test for a NULL value in the column.
UPDATE sometable SET somecolumn = @somevalue WHERE somecolumn IS NULL;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With