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 null in sql server?
How many cores do I need for sql server 2016?
How efficient you are in oracle and SQL server?
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
How to insert multiple rows with a subquery?
Explain how to integrate the ssrs reports in application?
Can group functions be used in the order by clause in ms sql server?
What is constraints and its types?
Do you know spatial data types - geometry and geography in sql server 2008?
How to change the data type of an existing column with "alter table" statements in ms sql server?
How to create a simple stored procedure in ms sql server?
What is change data capture (cdc) in sql server 2008?
How to declare and use cursor variables?
What are key constraints?
What is difference between standardization and normalization?