使用cursor 数据类型创建的所有变量都可以为 Null。 对于CREATE TABLE 语句中的列,不能使用 cursor 数据类型。 另请参阅 CAST 和 CONVERT (Transact-SQL) CURSOR_STATUS (Transact-SQL) 数据类型转换(数据库引擎) 数据类型 (Transact-SQL) DECLARE CURSOR (Transact-SQL) DECLARE @local_variable (Transact-SQL) ...
Transact-SQL 語法慣例 語法 syntaxsql sp_cursorfetchcursor [ , fetchtype [ , rownum [ , nrows ] ] ] [ ; ] 引數 重要 擴充預存程式的自變數必須依特定順序輸入,如語法一節所述。 如果參數依序輸入,就會發生錯誤訊息。 cursor 由SQL Server 產生的句柄值,並由傳sp_cursoropen回。cursor是呼叫int輸入值...
編譯提交之數據指標語句或批次的計劃,然後建立並填入數據指標。sp_cursorprepexec結合 和sp_cursorprepare的sp_cursorexecute函式。 這個程式是藉由在表格式數據流 (TDS) 封包中指定ID = 5來叫用。 Transact-SQL 語法慣例 語法 syntaxsql sp_cursorprepexecprepared handleOUTPUT, cursorOUTPUT, params...
下面的示例将打开一个全局游标,并使用sp_cursor_list报告该游标的属性。 SQL复制 USEAdventureWorks2022; GO-- Declare and open a keyset-driven cursor.DECLAREabcCURSORKEYSETFORSELECTLastNameFROMPerson.PersonWHERELastNameLIKE'S%'; OPEN abc;-- Declare a cursor variable to hold the cursor output variable-...
Transact-SQL 服务器游标。 API 服务器游标,由 ODBC 应用程序打开,然后调用 SQLSetCursorName 为游标命名。 使用sp_describe_cursor_columns 对游标返回的结果集的属性进行说明。使用 sp_describe_cursor_tables 报告游标引用的基表。sp_describe_cursor 报告的信息与 sp_cursor_list 相同,但只用于指定游标。 权限 执...
SQL Server Azure SQL 数据库 Azure SQL 托管实例 此函数返回连接上打开的最后一个游标中当前符合条件的行数。 为了提高性能,SQL Server 可异步填充大型键集和静态游标。@@CURSOR_ROWS可以调用以确定在调用时@@CURSOR_ROWS检索符合游标条件的行数。 Transact-SQL 语法约定 ...
The nonscalar types, cursor and table, can't be specified as a parameter data type in either Transact-SQL or CLR functions. If type_schema_name isn't specified, the Database Engine looks for the scalar_parameter_data_type in the following order: The schema that contains the names of SQL...
global_cursor_name 也可以是 API 服务器游标(由 ODBC 应用程序打开,然后通过调用SQLSetCursorName来命名)的名称。 [@cursor\_identity=] N'input_cursor_variable' ] 与打开的游标关联的游标变量的名称。 input_cursor_variable 的数据类型为 nvarchar(128)。
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...
SQL 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 are...