使用cursor 数据类型创建的所有变量都可以为 Null。 对于CREATE TABLE 语句中的列,不能使用 cursor 数据类型。 另请参阅 CAST 和 CONVERT (Transact-SQL) CURSOR_STATUS (Transact-SQL) 数据类型转换(数据库引擎) 数据类型 (Transact-SQL) DECLARE CURSOR (Transac
DECLARE CURSOR如果使用 Transact-SQL 语法未指定READ_ONLY,OPTIMISTIC或者SCROLL_LOCKS默认值如下所示: SELECT如果语句不支持更新(权限不足、访问不支持更新的远程表等),则游标为READ_ONLY。 STATIC和FAST_FORWARD游标默认为READ_ONLY。 DYNAMIC和KEYSET游标默认为OPTIMISTIC。
SQL Server Azure SQL 数据库 Azure SQL 托管实例 对于给定参数,CURSOR_STATUS显示游标声明是否已返回游标或结果集。 Transact-SQL 语法约定 语法 syntaxsql CURSOR_STATUS( {'local','cursor_name'} | {'global','cursor_name'} | {'variable','cursor_variable'} ) ...
Transact-SQL 語法慣例 語法 syntaxsql sp_cursorfetchcursor [ , fetchtype [ , rownum [ , nrows ] ] ] [ ; ] 引數 重要 擴充預存程式的自變數必須依特定順序輸入,如語法一節所述。 如果參數依序輸入,就會發生錯誤訊息。 cursor 由SQL Server 產生的句柄值,並由傳sp_cursoropen回。cursor是呼叫int輸入值...
相同的信息记录在由sp_describe_cursor返回的游标中的fetch_status列中。这些状态信息应该用于在对由 FETCH 语句返回的数据进行任何操作之前,以确定这些数据的有效性。有关详细信息,请参阅@@FETCH_STATUS (Transact-SQL)。 权限 FETCH 权限默认授予任何有效的用户。
{ |<auto_option>|<change_tracking_option>|<cursor_option>|<database_mirroring_option>|<date_correlation_optimization_option>|<db_encryption_option>|<db_state_option>|<db_update_option>|<db_user_access_option>|<delayed_durability_option>|<external_access_option>|<FILESTREAM_options>|<HADR_...
global_cursor_name 也可以是 API 服务器游标(由 ODBC 应用程序打开,然后通过调用SQLSetCursorName来命名)的名称。 [@cursor\_identity=] N'input_cursor_variable' ] 与打开的游标关联的游标变量的名称。 input_cursor_variable 的数据类型为 nvarchar(128)。
Transact-SQL 语法约定 语法 复制 sp_cursor_list [ @cursor_return = ] cursor_variable_name OUTPUT , [ @cursor_scope = ] cursor_scope [;] 参数 [@cursor\_return=] cursor_variable_nameOUTPUT 已声明的游标变量的名称。 cursor_variable_name 的数据类型为 cursor,无默认值。 游标是只读的可滚动动态...
In the first part of this chapter, we are going to show you how specialized hierarchies can be implemented in a SQL Server database. We’ll also show you how you can make use of their special property. Our recipe solutions are based on a real-world example of a hierarchical structure us...
SQLCopy USEmaster; GO-- In this example, OBJECT_ID is evaluated in the context of the master database.-- Because Person.Address does not exist in master, the function returns NULL.-- When NULL is specified as an object_id, all objects in the database are returned.-- The same results...