Simple example for difference between select and cursor in sql



Simple example for difference between select and cursor in sql..

Answer / manoj pandey

- SELECT is a Query operator, which is also called a set-based approach.

- CURSOR is a looping operator, which is also called a iterative approach or no-set based approach.

Ideally SELECT is more performant than CUSROSR, but there are certain scenarios when CURSOR are the last approach and sometimes beneficial.

More about Cursors:
- Cursor Life Cycle: http://sqlwithmanoj.wordpress.com/2010/10/24/sql-server-cursor-life-cycle/
- Cursor Performance: http://sqlwithmanoj.wordpress.com/2011/02/07/avoid-cursors-or-use-them-optimally/

Check my blog for more Interview Questions: http://sqlwithmanoj.wordpress.com/interview-questions/

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

How to delete the duplicate rows from a table in SQL Server ??

3 Answers  


What is trigger ?

7 Answers   Cap Gemini, SQL,


How do we know if any query is retrieving a large amount of data or very little data?

0 Answers  


How to convert a numeric expression from one data type to another?

0 Answers  


What is a trigger? Why we need it?

0 Answers   Accenture,






What is indexing explain it with an example?

0 Answers  


in emptable i want to retrive the name of employee whose name in 'J'char.exp: arjun,jagadesh,niranjan,anju,aaaj etc.

8 Answers  


List out the differences between global and local temp tables in sql server?

0 Answers  


Explain primary key, foreign key and unique key?

0 Answers  


What is the correct order of the logical query processing phases?

0 Answers  


What is sub query and its properties?

0 Answers  


Why use triggers?

0 Answers  


Categories