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

create table #temp (eid int, names varchar(10),sal int)

insert into #temp values (111, 'arun', 300)
insert into #temp values(112, 'ddd', 200)

insert into #temp values(113,'ttt',null)

select * from #temp

update #temp
set sal = isnull(sal,0)+ 100

select * from #temp

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you start single user mode in clustered installations?

913


Explain timestamp datatype?

931


Can you explain important index characteristics?

956


Explain the difference between primary keys and foreign keys?

964


What guidelines should be followed to help minimize deadlocks?

887


To which devices can a backup be created and where should these devices be located? : sql server management studio

991


What different steps will a sql server developer take to secure sql server?

948


What do you understand by user-defined function in the sql server?

918


How do you run a trace?

867


Tell me in brief how sql server enhances scalability of the database system?

951


How do you delete duplicate records in sql server?

1012


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

1030


how can u get last observation in an unknown dataset ?

2399


What do you mean by subquery?

1037


How many types of database relationship in sql server?

1012