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

What is a dataset and what are the different types of datasets?

141


which table keeps the locking information? : Sql server administration

1140


What is similarity and difference between truncate and delete in sql?

1154


What is the largest component inside a field?

1188


what's the difference between delete table and truncate table commands? : Sql server database administration

1040


What do you understand by SQL*Net?

1085


Explain the properties of a relational table?

1077


Write a SQL command to insert and update only a particular field?

1191


Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

997


how would you improve etl (extract, transform, load) throughput?

1074


What is the most common trace flags used with sql server?

1119


Explain full-text query in sql server?

1054


What are the different type of replication in sql server?

1015


Tell me about the approaches which you used to counter the DI problems.

1427


Explain the ways to controlling cursor behavior?

968