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

Explain the truncate command? : SQL Server Architecture

0 Answers  


What are the acid properties?

0 Answers  


What are SQL Jobs, please mention the use of it and how to create them.

1 Answers   247Customer,


what are the new features of sql server 2005?

8 Answers   HP, Keane India Ltd,


Can a table have 2 primary keys?

0 Answers  






do views contain data ?

0 Answers   MCN Solutions,


How to check if a table is being used in sql server?

0 Answers  


Tell me about pre-defined functions of sql?

0 Answers   EXL,


What is difference between global temporary tables and local temporary tables?

0 Answers   Tech Mahindra,


What is difference between inner join and full join?

0 Answers  


I have cleared sbi clerk examination. I am Bachelor in computer application (BCA) graduate. so which type of question related bca in sbi clerk interviews. pls answers me at sejalvaghela@yahoo.co.in.. and also tell me which type of question asked in sbi clerk interview.

1 Answers  


Are resultset updatable?

0 Answers  


Categories