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
How many types of built in functions are there in sql server 2012?
How do I find my localdb version?
How can we use ConnectorJ JDBC Driver with MS SQL?
What is inner join in sql server joins?
what's sql server? : Sql server database administration
How to Sync Two SQL Azure Databases?
How to name query output columns in ms sql server?
Explain the database you used in your final year project?
What are the benefits of filtered indexes?
Define the one-to-one relationship while designing tables.
How to return the date part only from a sql server datetime datatype?
What is model database in sql server?
How to disconnect from a sql server using mssql_close()?
What is your recommendation for a query running very slow? : sql server database administration
How to create an index on a view?