SSC-FDM-TS0028
Output parameters must have the same order as they appear in the executed code
Description
Code Example
Correct case
Transact
CREATE PROCEDURE CORRECT_OUTPUT_PARAMS_ORDER
AS
BEGIN
DECLARE @MaxAge INT;
DECLARE @MaxId INT;
EXECUTE sp_executesql
N'SELECT @MaxAgeOUT = max(AGE), @MaxIdOut = max(ID) FROM PERSONS WHERE ID < @id AND AGE < @age;',
N'@age INT, @id INT, @MaxAgeOUT INT OUTPUT, @MaxIdOUT INT OUTPUT',
30,
100,
@MaxAgeOUT = @MaxAge OUTPUT,
@MaxIdOut = @MaxId OUTPUT;
SELECT @MaxAge, @MaxId;
ENDSnowflake
Problematic case
Transact
Snowflake
Recommendations
Last updated
