How to avoid cursors?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you handle datasets larger than 50 gb?

140


What are the transaction properties?

560


How to call stored procedure using http soap?

524


What objects does the fn_my_permissions function reports on? : sql server security

563


How do I find the size of a sql server database?

497






Explain the ways to controlling cursor behavior?

548


Explain the truncate command? : SQL Server Architecture

567


Why do we use non clustered index?

555


What is the difference between a view and a stored procedure?

565


What is database mirroring?

567


Explain Reporting Life Cycle?

90


How do I run sql server 2014?

514


What is recompile sql server?

573


How do I start sql server 2017?

537


What is the boxing and unboxing concept in .net?

550