Concurrency, Cursors, and Transactions

  • Tony Bain
  • Louis Davidson
  • Robin Dewson
  • Chuck Hawkins


In this chapter, we will cover cursors, transactions, and concurrency:
  • ❑ Cursors

    These are mechanisms to code non-set-based operations into T-SQL statements. In general, their use is considered bad practice, but can be useful when building stored procedures if used properly.

  • ❑ Transactions

    Transactions are used to group together similar operations into one atomic logical operation. Transactions are important, as it can be dangerous to write stored procedures that modify data, without using transactions. Transactions allow us to construct stored procedures in the ‘either all or nothing’ manner, where if one part fails, any changes that have already been applied will be undone.

  • ❑ Concurrency

    Concurrency is related to multi tasking of operations. In databases, we are concerned with the number of queries that can be executed at the same time, especially making use of the same resources and data. Under concurrency, we will look at locks, which are the markers used by SQL Server to decide whether the commands can be executed concurrently or not. We will also discuss methods to maximize concurrency by using some programming schemes to limit SQL locking between read-only and read-write sessions.


Select Statement Repeatable Read Line Item Temporary Table Isolation Level 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Apress 2003

Authors and Affiliations

  • Tony Bain
    • 1
  • Louis Davidson
    • 2
  • Robin Dewson
  • Chuck Hawkins
    • 3
  1. 1.Tony Bain & AssociatesUSA
  2. 2.Christian Broadcasting Network and NorthStar StudiosNashvilleUSA
  3. 3.Compass Technology ManagementUSA

Personalised recommendations