SSC-EWI-TS0025

ERROR_SEVERITY function transformed

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.

Severity

Low

Generate Procedures and Macros using JavasScript as the target language adding the following flag -t JavaScript or --PLTargetLanguage JavaScript

Some parts of the output code are omitted for clarity reasons.

Description

This EWI is added when ERROR_SEVERITY built-in function is translated. By default, the function will return 16 as it is the most common severity in SQL Server. The generated UDF should retrie

Code Example

Input Code:

IN -> SqlServer_01.sql
-- Additional Params: -t JavaScript
CREATE procedure proc1()
as
BEGIN TRY  
    -- Generate a divide-by-zero error.  
    SELECT 1/0 from table1;  
END TRY  
BEGIN CATCH  
    return ERROR_SEVERITY();  
END CATCH;  
GO  

Output Code:

Recommendations

Last updated