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 / mohan

update #temp
set sal = COALESCE(sal+100,100)

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration

519


how to overcome kernel isssues

1179


What is the sql server agent?

591


Explain the microsoft sql server delete command? : SQL Server Architecture

587


What is explicit mode in sql server?

539






What is database mirroring?

569


What is an execution plan? How would you view the execution plan?

551


How do database indexes work?

546


What it means to be triggered?

506


Can you explain different types of joins?

549


Explain SSRS Architecture?

139


Explain the difference between control flow and data flow?

533


What are the types of sql server?

523


How to count duplicated values in a column in ms sql server?

521


What are the different types of locks in the database?

490