MSCEWI4045

Labeled Statement is not supported in Snowflake Scripting.

Severity

Low

Description

This EWI is added for all the LABELS used with the GOTO statement in SQL Server.

Code Example

Input Code:

CREATE PROCEDURE GoToProcedure
AS
BEGIN
DECLARE @TotalMaarks INT
SET @TotalMaarks = 49
IF @TotalMaarks >= 50
    GOTO Pass
IF @TotalMaarks < 50
    GOTO Fail
Pass:
    SELECT 1;
    SELECT * FROM TABLE1;
    RETURN 1;
Fail:
    SELECT 2;
    SELECT * FROM TABLE2;
    RETURN 2;
END

Output Code:

Recommendations

Last updated