SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Add a value IF ISNULL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

3 Posts

Posted - 05/14/2013 :  11:28:58  Show Profile  Reply with Quote

I need again your help. Something very easy for you I guess:

I need to add a value in the column of a table when the value is null.
So let's say I have table_ads with the columns:
id country
1 GB
2 GB
5 GB

I need an SQL query to add the value 'GB' when country IS NULL

Someone can help me?


James K
Flowing Fount of Yak Knowledge

3814 Posts

Posted - 05/14/2013 :  12:13:39  Show Profile  Reply with Quote
UPDATE table_ads SET country = 'GB' WHERE country IS NULL;
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000