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

update tablename set salary=100 where salary is null

Is This Answer Correct ?    6 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is compression - row-level and page-level compression?

684


Explain differences between web edition and business edition?

115


What happens if you add a new index to large table?

682


Explain about analysis services?

760


In my application I have a process which picks the scanned files (tif format) from a shared location and it links to application and shown on it.The actuall issue is that my process picks the file before it is completly written or scanned which results in displaying few parts of the image or incomplete image.I need to check if the file is not completly scanned or written then do not link it to application.Please help if any body tell me that how can i check that file is in written phase or locked through DTS.thanking you in advance

1717






What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas

726


What is ddl command?

701


Explain the working of sql privileges?

800


What is log in sql server?

761


What is a field name?

709


As per your opinion what are the five top responsibilities of a dba? : sql server database administration

829


What are commit and rollback in sql?

743


What are transactions and its controls?

796


What is data modeling and Reterminal integrity?

1692


what is spatial nonclustered index

720