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

Is sql server a database?

921


To which devices can a backup be created and where should these devices be located? : sql server management studio

964


Does the unique constraint create an index?

985


Which are the third-party tools used in sql server and why would you use them?

843


Differentiate between a primary key and a unique key.

998


What is database mirroring?

1037


What is stored in the mssqlsystemresource database? : sql server database administration

986


What is the command to change the recovery model?

996


What is use of except clause?

1036


Is it possible to create trigger on views?

931


What is the recommended total size of your memory optimized tables?

910


What do you mean by an execution plan? Why is it used?

952


What is difference between standardization and normalization?

1017


How to check status of stored procedure in sql server?

911


What are out-of-range errors with date and time literals?

965