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 does select 1 mean?
What are different types of constraints?
What is user-defined functions? What are the types of user-defined functions that can be created?
What are the purpose of Normalisation?
Tell me what is log shipping?
Which is faster statement or preparedstatement?
whats the maximum size of view state??
What are scalar functions?
Is sql different from sql server?
What is the difference between sdf and mdf?
Do you know what is fill factor and pad index?
You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?
What is database black box testing?
How do I view a stored procedure in sql server query?
What are blobs, tables, and Queues? Is SQL is the standard way to query blobs, tables, and queues?