LABEL and GOTO

Translation reference to convert LABEL AND GOTO in Transact-SQL

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Applies to

Description

Snowflake SQL does not support GOTO LABEL statements. Currently, LABELS are commented and warning is added for all the occurrences.

Sample Source Patterns

The following examples details the BEGIN and COMMIT transaction statements.

Transact-SQL

IN -> SqlServer_01.sql
CREATE PROCEDURE GoToProcedure
AS
BEGIN
DECLARE @TotalMaarks INT
SET @TotalMaarks = 49;
IF @TotalMaarks >= 50
    GOTO Pass
IF @TotalMaarks < 50
    GOTO Fail
Pass:
    SELECT 1;
    RETURN 1;
Fail:
    SELECT 2;
    RETURN 2;
END

Snowflake SQL

LABEL and GOTO statement outside routines (functions and procedures)

Transact-SQL

Snowflake Scripting

Known Issues

No issues were found.

  1. SSC-EWI-TS0045: Labeled Statement is not supported in Snowflake Scripting.

  2. SSC-EWI-0073: Pending Functional Equivalence Review.

Last updated