Cursor select Statements

Consider the following when using cursor select statements.

  • select_statement can use the full syntax and semantics of a Transact-SQL select statement, with these restrictions:
    • Must contain a from clause

    • Cannot contain a compute, for browse, or into clause

    • Can contain the holdlock keyword

  • The select_statement can contain references to Transact-SQL parameter names or Transact-SQL local variables (for all cursor types except language). The names must reference the Transact-SQL parameters and local variables defined in the procedure, trigger, or statement batch that contains the declare cursor statement.

    The parameters and local variables referenced in the declare cursor statement do not have to contain valid values until the cursor is opened.

  • The select_statement can contain references to the inserted and deleted temporary tables that are used in triggers.