Advantages and Disadvantages of Cursor?
Answer Posted / sarat
Cursors allow row-by-row processing of the resultsets.
Disadvantages of cursors: Each time you fetch a row from the
cursor, it results in a network roundtrip, where as a normal
SELECT query makes only one rowundtrip, however large the
resultset is. Cursors are also costly because they require
more resources and temporary storage (results in more IO
operations). Further, there are restrictions on the SELECT
statements that can be used with some types of cursors.
Most of the times, set based operations can be used instead
of cursors.
Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
What is local temp table?
Is sql server 2016 free?
Can you insert NULL in unique column?
Is it important for a database administrator to understand the operating system and file access?
How to write a query with a right outer join in ms sql server?
Why do we use trigger?
How to trouble shoot if unable to connect SQL Server
We are updating a field in sql and alter the row also.after giving the commit command the system is crashed.what will happen to the commands given,whether it will update and alter the table or not?
what are database files and filegroups? : Sql server database administration
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
Ms sql server index?
What is temporary table in sql server? Why we use temp table?
What is difference between createstatement and preparedstatement?
How to delete duplicate rows in sql server?
How to create new databases with "create database" statements?