Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to update a null value field in sql server

eg
a table contains 3 fields id,name,salary
and 3 records
salary of 1 record is null
i want update the nullfield

111 arun 300
112 ddd 200
113 ttt null
i want to update table with add 100 to every record include null
after updation
the recrds should be
111 arun 400
112 ddd 300
113 ttt 100

Answer Posted / ganesh.k

UPDATE Table_Name SET Salary = COALESCE(Salary,0) + 100

(Or)

UPDATE Table_Name SET Salary = ISNULL(Salary,0) + 100

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of built in functions are there in sql server 2012?

926


How do I find my localdb version?

988


How can we use ConnectorJ JDBC Driver with MS SQL?

1001


What is inner join in sql server joins?

1041


what's sql server? : Sql server database administration

1001


How to Sync Two SQL Azure Databases?

121


How to name query output columns in ms sql server?

968


Explain the database you used in your final year project?

1045


What are the benefits of filtered indexes?

1041


Define the one-to-one relationship while designing tables.

903


How to return the date part only from a sql server datetime datatype?

1106


What is model database in sql server?

1056


How to disconnect from a sql server using mssql_close()?

1112


What is your recommendation for a query running very slow? : sql server database administration

1050


How to create an index on a view?

1070