/* Execute the string with the first parameter value. */ SET @IntVariable = 35 EXECUTE sp_executesql @SQLString, @ParmDefinition, @level = @IntVariable /* Execute the same string with the second parameter value. */ SET @IntVariable = 32 EXECUTE sp_executesql @SQLString, @ParmDefinition...
SQL Server、Azure SQL 資料庫、Azure SQL 受控執行個體、Azure Synapse Analytics 和 Analytics Platform System (PDW) 的語法。 syntaxsql 複製 sp_executesql [ @stmt = ] N'statement' [ [ , [ @params = ] N'@parameter_name data_type [ { OUT | OUTPUT } ] [ , .....
Syntax for SQL Server, Azure SQL Database, Azure SQL Managed Instance, Azure Synapse Analytics, and Analytics Platform System (PDW).syntaxsql Másolás sp_executesql [ @stmt = ] N'statement' [ [ , [ @params = ] N'@parameter_name data_type [ { OUT | OUTPUT } ] [ , ......
sp_executesql支持与 Transact-SQL 字符串相独立的参数值的设置: DECLARE@IntVariableINTDECLARE@SQLStringNVARCHAR(500)DECLARE@ParmDefinitionNVARCHAR(500)/* Build the SQL string once. */SET@SQLString=N'SELECT * FROM pubs.dbo.employee WHERE job_lvl = @level'/* Specify the parameter format once. */...
SQL Server、Azure SQL 数据库、Azure SQL 托管实例、Azure Synapse Analytics 和 Analytics Platform System(PDW)的语法。 syntaxsql sp_executesql[ @stmt = ]N'statement'[ [ , [ @params = ]N'@parameter_name data_type [ { OUT | OUTPUT } ] [ , ...n ]'] [ , [ @param1 = ]'value1'...
/* Execute the string with the first parameter value. */ SET @IntVariable = 197; EXECUTE sp_executesql @SQLString, @ParmDefinition, @BusinessEntityID = @IntVariable; /* Execute the same string with the second parameter value. */ SET @IntVariable = 109; EXECUTE sp_executesql @SQLString...
Syntax for SQL Server, Azure SQL Database, Azure SQL Managed Instance, Azure Synapse Analytics, and Analytics Platform System (PDW). syntaxsql sp_executesql[ @stmt = ]N'statement'[ [ , [ @params = ]N'@parameter_name data_type [ { OUT | OUTPUT } ] [ , ...n ]'] [ , [...
SET@ParmDefinition=N'@level tinyint'/* Execute the string with the first parameter value. */SET@IntVariable=35EXECUTEsp_executesql@SQLString,@ParmDefinition,@level=@IntVariable/* Execute the same string with the second parameter value. */SET@IntVariable=32EXECUTEsp_executesql@SQLString,@Parm...
SQL Server、Azure SQL 数据库、Azure SQL 托管实例、Azure Synapse Analytics 和 Analytics Platform System(PDW)的语法。 syntaxsql sp_executesql[ @stmt = ]N'statement'[ [ , [ @params = ]N'@parameter_name data_type [ { OUT | OUTPUT } ] [ , ...n ]'] [ , [ @param1 = ]'value1'...
Syntax for SQL Server, Azure SQL Database, Azure SQL Managed Instance, Azure Synapse Analytics, and Analytics Platform System (PDW). syntaxsqlCopy sp_executesql[ @stmt = ]N'statement'[ [ , [ @params = ]N'@parameter_name data_type [ { OUT | OUTPUT } ] [ , ...n ]'] [ ...