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 sql servers used for?
Explain try...catch with sql server?
How to delete all rows with truncate table statement in ms sql server?
Explain error and transaction handling in sql server?
What are the restraints imposed on the table design by a merge replication?
What do you mean by a Composite primary key?
What are the recovery models in sql server 2000?
What is the difference between row_number and dense_rank?
Where sql server user names and passwords are stored in sql server? : sql server database administration
What is normalization? What number of normalization shapes are there?
How to name query output columns in ms sql server?
What is the difference between Stored Procedures and triggers?
How to find the login name linked to a given user name?
What do you mean by the term 'normalization'?
what are database files and filegroups? : Sql server database administration