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 |
What are statistics, under what circumstances they go out of date, how do you update them?
What is the difference between local and global temporary tables?
What are the differences between INNER JOIN, LEFT JOIN and RIGHT JOIN in SQL Server?
What are triggers? How do you invoke a trigger on demand?
Can you name some of the dml commands in sql?
What are the different subsets of sql?
How to verify a login name with sqlcmd tool?
wat is mean by trigger?.......normally wat use......when trigger used in sql........... plz cleary say with example.......
If we delete pack Spec what will be the status of pack Body ?
I have a huge amount of data which is displayed in a report. The data is viewed every day. Every day the data is displayed in 30 secs but suddenly today it is giving an timeout message today. Data has not been changed. The situation is same as yesterday. What might be the reason??? Please Answer.
What is the purpose of object explorer and its features? : sql server management studio
What are different types of join?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)