CLOSE--关闭游标 PREPARE--为动态执行准备SQL 语句 EXECUTE--动态地执行SQL 语句 DESCRIBE--描述准备好的查询 ---局部变量 declare@idchar(10) --set @id = '10010001' select@id='10010001' ---全局变量 ---必须以@@开头 --IF ELSE declare@xint@yint@zint
SQL העתק IF 1 = 1 PRINT 'Boolean expression is true.' ELSE PRINT 'Boolean expression is false.'; The following example has a Boolean expression (1 = 2) that is false, and therefore prints the second statement.SQL העתק ...
ELSE (IF...ELSE) (Transact-SQL) ENABLE TRIGGER (Transact-SQL) ENCRYPTBYASYMKEY (Transact-SQL) ENCRYPTBYCERT (Transact-SQL) ENCRYPTBYKEY (Transact-SQL) ENCRYPTBYPASSPHRASE (Transact-SQL) END (BEGIN...END) (Transact-SQL) END CONVERSATION (Transact-SQL) ERROR_LINE (Transact-SQL) ERROR_MESSAG...
syntaxsql IFboolean_expression{sql_statement|statement_block} [ELSE{sql_statement|statement_block} ] Arguments boolean_expression An expression that returnsTRUEorFALSE. If the Boolean expression contains aSELECTstatement, theSELECTstatement must be enclosed in parentheses. ...
DENY (Transact-SQL) DIFFERENCE (Transact-SQL) DISABLE TRIGGER (Transact-SQL) DROP 陳述式 (Transact-SQL) ELSE (IF...ELSE) (Transact-SQL) ENABLE TRIGGER (Transact-SQL) ENCRYPTBYASYMKEY (Transact-SQL) ENCRYPTBYCERT (Transact-SQL) ENCRYPTBYKEY (Transact-SQL) ...
EXECUTE --动态地执行SQL 语句 DESCRIBE --描述准备好的查询 ---局部变量 declare @id char(10) --set @id = '10010001' select @id = '10010001' ---全局变量 ---必须以开头 --IF ELSE declare @x int @y int @z int select @x = 1 @y = 2 @z=3 ...
適用於:SQL Server Azure SQL 資料庫 Azure SQL 受控執行個體 Azure Synapse Analytics Analytics Platform System (PDW) Microsoft Fabric 的 SQL 端點分析 Microsoft Fabric 的倉儲 在SQL Server、Azure SQL Database 和 Analytics Platform System (PDW) 中建立 Transact-SQL 或 Common Language Runtime (CLR) 預...
保留关键字 (Transact-SQL)Microsoft SQL Server 将保留关键字用于定义、操作和访问数据库。保留关键字是 SQL Server 使用的 Transact-SQL 语言语法的一部分,用于分析和理解 Transact-SQL 语句和批处理。尽管在 Transact-SQL 脚本中使用 SQL Server 保留关键字作为标识符和对象名在语法上是可行的,但规定只能使用分隔...
If noinput_expression=when_expressionevaluates to TRUE, the SQL Server Database Engine returns theelse_result_expressionif an ELSE clause is specified, or a NULL value if no ELSE clause is specified. Searched CASE expression: Evaluates, in the order specified,Boolean_expressionfor each WHEN clause...
SQL 复制 USE AdventureWorks2022; GO IF OBJECT_ID ('dbo.Table1', 'U') isn't NULL DROP TABLE dbo.Table1; GO IF OBJECT_ID ('dbo.Table2', 'U') isn't NULL DROP TABLE dbo.Table2; GO CREATE TABLE dbo.Table1 (ColA INT NOT NULL, ColB DECIMAL(10,3) NOT NULL); GO CREATE TABLE...