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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Add a value IF ISNULL
 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

3873 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  
 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.02 seconds. Powered By: Snitz Forums 2000