Simple example for difference between select and cursor in sql
- 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 |
How to delete the duplicate rows from a table in SQL Server ??
What is trigger ?
How do we know if any query is retrieving a large amount of data or very little data?
How to convert a numeric expression from one data type to another?
What is a trigger? Why we need it?
What is indexing explain it with an example?
in emptable i want to retrive the name of employee whose name in 'J'char.exp: arjun,jagadesh,niranjan,anju,aaaj etc.
List out the differences between global and local temp tables in sql server?
Explain primary key, foreign key and unique key?
What is the correct order of the logical query processing phases?
What is sub query and its properties?
Why use triggers?