What are cursors and when they are useful?
Answer / Pawan Kumar Shukla
A cursor in SQL Server is a server-side temporary stored reference to a rowset. It allows executing a sequence of RBAR (Row by Agonizing Row) operations on the rows within a result set. Cursors can be useful for handling complex data manipulation tasks or situations where looping over each row of a result set is necessary.nnExample: Declaring and opening a cursor:nDECLARE MyCursor CURSOR FOR SELECT * FROM Customers;nOPEN MyCursor
| Is This Answer Correct ? | 0 Yes | 0 No |
What happens if time-only values are provided as date and time literals?
List out the different types of locks available in sql server?
Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?
How to set a database state to offline in ms sql server?
What is use of except clause?
What are the different SQL Server Versions you have worked on?
Suppose i have one sql query that contains 2 minute to execute.After one weekly i am executing same query that is taking 5 minute.Why our same query is taking more time.what would be my approach to reduce execution time.Please help.
1 Answers Cognizant, HCL, Value Labs,
What is the purpose of indexing?
Why functions are used in sql server?
What is the importance of a recovery model?
Tell me about normalization in DBMS.
if 3 duplicate records in a table,i want to delete 2 duplicate records by keeping 1 duplicate and 1 original as it is,how?
Oracle (3253)
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)