可以是資料指標類型或另一個資料指標變數的目標。 如需詳細資訊,請參閱SET @local_variable (Transact-SQL)。 如果資料指標變數目前未指派任何資料指標,就可以在 EXECUTE 陳述式中,將其當做輸出資料指標參數的目標來參考。 應該視為指向資料指標的指標。
* 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 the values of thread-locals. * * @param value the value to be stored in ...
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...
指定将(使用 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, use EXECUTE. Although syntax rules for SET @cursor_variable include the LOCAL and GLOBAL keywords, when you use the SET @cursor_variable = CURSOR... syntax, the ...
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).@...
For more information about system data types, see Data Types (Transact-SQL). For more information about CLR user-defined types or alias data types, see CREATE TYPE (Transact-SQL). = value Assigns a value to the variable in-line. The value can be a constant or an expression, but it mus...
In SQL Server 2000, FAST_FORWARD and FORWARD_ONLY cursor options are mutually exclusive. If one is specified, the other cannot be, and an error is raised. In SQL Server 2005, both keywords can be used in the same DECLARE CURSOR statement. ...
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...