Simple example for difference between select and cursor in sql
Answer Posted / 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 View All Answers
What are the properties of sub-query?
How do I create a stored procedure in sql server?
what is a join and explain different types of joins? : Sql server database administration
List types of tables in SQL Azure?
What is a livelock?
what are the disadvantages of cursors? : Sql server database administration
How to delete all rows with truncate table statement in ms sql server?
What is the most common trace flags used with sql server?
Explain tables in SQL Azure?
What is a fan-out query in SQL Azure?
Explain what is “asynchronous” communication in sql server service broker?
Can we store videos inside the sql server table?
What is the sql case statement used for? Explain with an example?
What is transaction server implicit?
What is the purpose of optimization?