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
Is sql server a database?
To which devices can a backup be created and where should these devices be located? : sql server management studio
Does the unique constraint create an index?
Which are the third-party tools used in sql server and why would you use them?
Differentiate between a primary key and a unique key.
What is database mirroring?
What is stored in the mssqlsystemresource database? : sql server database administration
What is the command to change the recovery model?
What is use of except clause?
Is it possible to create trigger on views?
What is the recommended total size of your memory optimized tables?
What do you mean by an execution plan? Why is it used?
What is difference between standardization and normalization?
How to check status of stored procedure in sql server?
What are out-of-range errors with date and time literals?