Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. DECLARE CURSOR accepts both a syntax based on the ISO standard and a syntax using a set of Transact-SQL extensions....
For example, suppose a static cursor fetches a row, and another application then updates that row. If the application refetches the row from the static cursor, the values it sees are unchanged, despite the changes made by the other application. All types of scrolling are supported. ...
Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates.
SQL Server Azure SQL 数据库 Azure SQL 托管实例 Microsoft Fabric SQL 数据库 定义了 Transact-SQL 服务器游标的属性,例如游标的滚动行为和用于生成游标所操作的结果集的查询。DECLARE CURSOR既接受基于 ISO 标准的语法,也接受使用一组 Transact-SQL 扩展的语法。
DECLARE CURSOR 定义 Transact-SQL 服务器游标的特性,例如游标的滚动行为和用于生成游标对其进行操作的结果集的查询。OPEN 语句填充结果集,FETCH 从结果集返回行。CLOSE 语句释放与游标关联的当前结果集。DEALLOCATE 语句释放游标所使用的资源。 DECLARE CURSOR 语句的第一种格式使用 SQL-92 语法声明游标行为。DECLARE CUR...
SQL Server Azure SQL 数据库 Azure SQL 托管实例 Microsoft Fabric SQL 数据库 定义了 Transact-SQL 服务器游标的属性,例如游标的滚动行为和用于生成游标所操作的结果集的查询。DECLARE CURSOR既接受基于 ISO 标准的语法,也接受使用一组 Transact-SQL 扩展的语法。
如果GLOBAL 和 LOCAL 参数都未指定,则默认值由default to local cursor数据库选项的设置控制。在 SQL Server 7.0 版中,该选项默认为 FALSE,以便与 SQL Server 的早期版本匹配,在早期版本中,所有游标都是全局的。该选项的默认值在以后的 SQL Server 版本中可能会更改。有关详细信息,请参阅设置数据库选项。
Gilt für: SQL Server Azure SQL-Datenbank Azure SQL Managed Instance SQL-Datenbank in Microsoft Fabric Definiert die Attribute eines Transact-SQL-Servercursors, wie z. B. dessen Scrollverhalten sowie die Abfrage, die zum Erstellen des Resultsets verwendet wird, in dem der Cursor ausgeführt wird...
Is the name of the Transact-SQL server cursor defined. cursor_name must conform to the rules for identifiers. For more information about rules for identifiers, see Using Identifiers As Object Names. LOCAL Specifies that the scope of the cursor is local to the batch, stored proc...
代码如下:begindeclare @class_noidA char(4), @class_noidB char(4),@spnoidA char(8),@spnoidB char(8)declare class_cursorA cursor local forward_onlyfor select class_no,spno from deleteddeclare class_cursorB cursor local forward_onlyfor select class_no,spno from insertedopen ...