* Sets the current thread's copy of this thread-local variable * to the specified value. Most subclasses will have no need to * override this method, relying solely on the {@link #initialValue} * method to set
可以是游标类型或其他游标变量的目标。 有关详细信息,请参阅SET @local_variable (Transact-SQL)。 如果当前没有给游标变量分配游标,则可在 EXECUTE 语句中作为输出游标参数的目标引用。 应被看作是指向游标的指针。 示例 A. 使用 DECLARE 下例将使用名为@find的局部变量检索所有姓氏以Man开头的联系人信息。
SQL 複製 DECLARE my_cursor CURSOR GLOBAL FOR SELECT * FROM Purchasing.ShipMethod DECLARE @my_variable CURSOR ; SET @my_variable = my_cursor ; --There is a GLOBAL cursor declared(my_cursor) and a LOCAL variable --(@my_variable) set to the my_cursor cursor. DEALLOCATE my_cursor; GO ...
指定将(使用 DECLARE@local_variable创建的)给定的局部变量设置为指定的表达式。 建议将 SET@local_variable而不是 SELECT@local_variable用于变量赋值。 在第一个示例中,将变量 @var1 赋给 Generic Name 作为它的值。在 Customers 表中不存在为 CustomerID 指定的值,因此对该表的查询不返回行。该变量将保留 Gene...
适用于:sql Server Azure SQL 数据库 Azure SQL 托管实例 Microsoft Fabric Warehouse Microsoft Fabric SQL 数据库中的 Azure Synapse Analytics SQL 分析终结点Microsoft Fabric 数据库中 将局部变量设置为表达式的值。 要分配变量,建议使用 SET @local_variable,而不是 SELECT @local_variable。 Transact-SQL 语法...
You can use variables only in expressions, not instead of object names or keywords. To construct dynamic Transact-SQL statements, useEXECUTE. Although syntax rules forSET @cursor_variableinclude theLOCALandGLOBALkeywords, when you use theSET @cursor_variable = CURSOR...syntax, the cursor is create...
A sintaxe a seguir é do SQL Server e do Banco de Dados SQL do Azure:syntaxsql Copiar DECLARE { { @local_variable [AS] data_type [ = value ] } | { @cursor_variable_name CURSOR } } [ ,...n ] | { @table_variable_name [AS] } ::= TABLE ( { <column_definition> | ...
Assigns a value to the variable in-line. The value can be a constant or an expression, but it must either match the variable declaration type or be implicitly convertible to that type. For more information, see Expressions (Transact-SQL).@...
SQL Server 实用工具语句 存储过程函数 (Transact-SQL) 系统存储过程 (Transact-SQL) 系统表 (Transact-SQL) 系统视图 (Transact-SQL) 事务语句 (Transact-SQL) 变量(Transact-SQL) 变量(Transact-SQL) DECLARE @local_variable (Transact-SQL) SET @local_variable (Transact-SQL) ...
Cursor variable values do not change after a cursor is declared. In SQL Server version 6.5 and earlier, variable values are refreshed every time a cursor is reopened. A cursor variable: Can be the target of either a cursor type or another cursor variable. For more information, seeSET@local...