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
Explain the use of keyword with encryption. Create a store procedure with encryption?
Why use stored procedures in sql server?
What is SubQuery in SQL Server 2008
Explain iaas, paas and saas?
Why use view instead of a table?
What does it mean to normalize data?
let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration
What is BCNF? How is it better than 2NF & 3NF?
What happens when converting big values to numeric data types?
how can u get last observation in an unknown dataset ?
What is the use of =,==,=== operators?
Is it true, that there is no difference between a rule and a check constraint?
How self join is different from outer join?
How to replace the Query Result 'Null Value' with a text ?
Explain what are various ways to enhance the ssrs report?