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


Please Help Members By Posting Answers For Below Questions

Is null in sql server?

962


How many cores do I need for sql server 2016?

862


How efficient you are in oracle and SQL server?

1103


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1721


How to insert multiple rows with a subquery?

1080


Explain how to integrate the ssrs reports in application?

972


Can group functions be used in the order by clause in ms sql server?

977


What is constraints and its types?

893


Do you know spatial data types - geometry and geography in sql server 2008?

984


How to change the data type of an existing column with "alter table" statements in ms sql server?

952


How to create a simple stored procedure in ms sql server?

993


What is change data capture (cdc) in sql server 2008?

999


How to declare and use cursor variables?

1103


What are key constraints?

943


What is difference between standardization and normalization?

1036