CREATE PROC Procout(@input INT, @result INT output) AS BEGIN SET @result = @input END go DECLARE @input INT SET @input = 100 DECLARE @output INT SET @output = 0 --声明执行sql DECLARE @sql NVARCHAR(1000) SET @sql = 'exec procout @input_, @output_ out' --定义参数列表 DECLARE @ParmDefinition NVARCHAR(500); SET @ParmDefinition = N'@input_ int, @output_ int OUTPUT'; EXEC Sp_executesql @sql, @ParmDefinition, @input_ = @input, @output_ = @output output; SELECT @output go