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 avoid cursors?

Answers were Sorted based on User's Feedback



How to avoid cursors?..

Answer / mahima

to avoid cursor use CASE and SET .
to give increment to the employee depending upon the salary

update empsal
set
case when sal between 2000 AND 3000 then sal+1000
when sal between 3000 AND 4000 then sal+2000
end

Is This Answer Correct ?    6 Yes 3 No

How to avoid cursors?..

Answer / veeresh kethari

1.By using case.. set,we can avoid the cursors

2.By using temporary tables/table variables/CTE
with while loop we can avoid cursor in the transaction.

Is This Answer Correct ?    3 Yes 1 No

How to avoid cursors?..

Answer / sunny

update salary set sal=(
case
when sal between 100 and 300 then sal + 1000
when sal between 300 and 500 then sal + 2000
when sal between 500 and 700 then sal + 3000
end)

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More SQL Server Interview Questions

What is raid, and how it can influence database performance?

0 Answers  


How can you start sql server in different modes?

0 Answers  


Can we add a cpu to sql server?

0 Answers  


What is store procedure? How do they work?

0 Answers  


What are the differences between lost updates and uncommitted dependencies?

0 Answers  


How can you swap values between two rows in a table using single- SQL statement?

1 Answers   Tavant Technologies, Virtusa,


What is sqlcmd?

0 Answers  


I have to display ten columns values from diffrent ten tables. how many joins are require?

10 Answers   CarrizalSoft Technologies, HCL,


Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?

0 Answers  


I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

0 Answers   IBM,


How to write query to Delete the records in child table and corresponding records in parent table

11 Answers   Semantic Space,


What is statement level trigger?

0 Answers  


Categories