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 is the difference between DataRow.Delete() and DataRow.Remove()?

740


Explain “@@rowcount” and “@@error” in sql server?

541


What is difference between index and primary key?

590


How many replicas are maintained for each sql azure db?

106


What are key, name and value columns of an attribute? : sql server analysis services, ssas

574






What is the maximum number of index per table?

566


my name is sejal I have cleared the sbi clerk exam. I am BCA graduate My favorite subject RDBMS Relational database management system. so please send me rRDBMS related interview questions

1539


What is a schema in ms sql server 2005?

567


What does set rowcount do?

516


What is bookmark link in ssrs?

108


What is molap and its advantage? : sql server analysis services, ssas

550


What authentication modes does sql server support?

599


Explain index in sql server?

598


Can you explain about buffer cash and log cache in sql server?

506


How to access the inserted record of an event?

574