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
Which are the two editions in which SQL Azure database available?
How can we delete Duplicate row in table?
can a database be shrunk with users active? : Sql server administration
How to use linked server?
What is a subquery in a select query statement in ms sql server?
Does sql server use java?
You want to implement the one-to-many relationship while designing tables. How would you do it?
Explain about protocol layer present in SQL server?
Can we insert data into a view?
What is the report model project?
Can You Use A Stored Procedure To Provide Data To An Ssrs Report?
What is command parameter in ssrs?
Can two tables share the same primary key?
What is the difference between coalesce() & isnull()?
What is the status of services on passive node for failover cluster in sql server? : sql server database administration