Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Update if null

Author  Topic 

Apples
Posting Yak Master

146 Posts

Posted - 2008-05-06 : 10:14:49
Here's my table:

----------------------------
Members
----------------------------
Subscriber | Name
----------------------------


Subscriber is a True/False value. However, some members have a NULL value in the Subscriber field. I'd like to go through all the members and update the Subscriber field to be 'False' if the value in there is NULL.

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2008-05-06 : 10:16:40
update members set subscriber = 'False' where subscriber is null


"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-06 : 10:16:47
[code]Update Members
Set Subscriber = 'False'
Where Subscriber Is Null[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Apples
Posting Yak Master

146 Posts

Posted - 2008-05-06 : 10:32:17
Thanks!
Go to Top of Page
   

- Advertisement -