Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

solution 1:
update table_name set
salary = isnull(salary,0) + 100

solution 2:
update table_name set
salary = case when
salary is null then 100
else salary + 100
end

Is This Answer Correct ?    49 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the events recorded in a transaction log?

1000


What is replace and stuff function in sql server?

1065


What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

1048


What is intellisense?

1053


Can binary strings be used in arithmetical operations?

937


How to generate create table script on an existing table in ms sql server?

1142


What is dbcc command in sql server?

1092


you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration

1081


How does the report manager work in SSRS?

150


Explain concepts of analysis services?

963


What are the different types of subquery?

1158


What are transactions and its controls?

1061


When multiple after triggers are attached to sql table, how to control the order of execution?

1049


Explain various data region available in ssrs with their use?

933


What is the difference between NOROW and LOCKROW?

2838