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
What are the differences between union, intersect, and minus operators?
What can be used instead of trigger?
How many types of dimensions are there and what are they? : sql server analysis services, ssas
What is tablix?
Can we update data in a view?
Mention the command used to rename the database.
What is the use of “join” in sql server?
Mention the 3 ways to get a count of the number of records in a table.
How to drop an existing user defined function in ms sql server?
Explain what is lock escalation and what is its purpose?
How to query multiple tables jointly?
You are creating an application where users are asked their gender in the gender combo box you have three options: ‘male’ , ‘female’ and ‘i choose not to disclose’ these options are stored in the table as 1, 0 or null which datatype should you use?
List some of the rules that apply to creating and using a ‘view’
what is package and it uses and how can u call a package
How many non clustered indexes there can be on table ?