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
Mention a few common trace flags used with sql server?
How to end a stored procedure properly in ms sql server?
What are the properties of the transaction?
Explain the microsoft sql server delete command? : SQL Server Architecture
What are the dmvs?
How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?
Can you explain powershell included in sql server 2008?
Why use identity in sql server?
What are sp_configure commands and set commands?
Define right outer join in sql server joins?
Tell me what are the advantages of using stored procedures?
What are the 3 types of schema?
Explain the difference between cross join and full outer join?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?
what are the core components of SSRS?