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

How can we Use Linked Server? Uses of Linked server

1 Answers   IBM,


What is a scheduled job or what is a scheduled task?

0 Answers  


What is sparse columns of sql server 2008?

0 Answers  


How to create a new table in a given schema?

0 Answers  


What is a job?

3 Answers  


What are the main sources of data?

0 Answers  


Is it important for a database administrator to understand the operating system and file access?

0 Answers  


What is the disadvantage of using subquery exact after a select statement?ex. select (select * from sometable)

1 Answers  


What is the purpose of data source?

0 Answers  


How to insert multiple rows with a subquery?

0 Answers  


What are the advantages of using stored procedures?

0 Answers  


How many types of indexes are there in SQL Server?

6 Answers   CarrizalSoft Technologies, United Healthcare,


Categories