![]() However, there are scenarios where cursors are not only unavoidable, they are actually needed. In some scenarios, if there is a primary key on a table, a WHILE loop can be used instead of a cursor, without incurring in the overhead of a cursor. ![]() Providing Transact-SQL statements in scripts, stored procedures, and triggers access to the data in a result set. Supporting different levels of visibility to changes made by other users to the database data that is presented in the result set. Supporting data modifications to the rows at the current position in the result set. Retrieving one row or block of rows from the current position in the result set. Cursors are an extension to result sets that provide that mechanism.Īllowing positioning at specific rows of the result set. These applications need a mechanism to work with one row or a small block of rows at a time. Applications, especially interactive online applications, cannot always work effectively with the entire result set as a unit. This complete set of rows returned by the statement is known as the result set. For example, the set of rows returned by a SELECT statement consists of all the rows that satisfy the conditions in the WHERE clause of the statement. Operations in a relational database act on a complete set of rows. Applies to: SQL Server (all supported versions) Azure SQL Database
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |