SnowConvert AI - SQL Server-Azure Synapse Functional Differences¶
Applies to
SQL Server
Azure Synapse Analytics
SSC-FDM-TS0001¶
Note
This FDM is deprecated, please refer to SSC-EWI-TS0077 documentation
Description¶
This message is shown when there is a collate clause that is not supported in Snowflake.
Code example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0002¶
Description¶
This message is shown when there is a collate clause that is not supported in Snowflake.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0003¶
XP_LOGININFO mapped to custom UDF
Description¶
This message is shown when the XP_LOGININFO procedure is executed and returns the following set of columns (See SQL SERVER documentation for more info (https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-logininfo-transact-sql?view=sql-server-ver16))
| account name | type | privilege | mapped login name | permission path |
To replicate this behavior, there is a query that select the columns from the APPLICABLE_ROLES view in Snowflake, which returns the following set of columns (See Snowflake documentation for more info)
GRANTEE |
ROLE_NAME |
ROLE_OWNER |
IS_GRANTABLE |
|---|
SQL Server original columns are mapped as shown in the next table. They may be not completely equivalent.
| SQL Server | Snowflake | |
|---|---|---|
| account name | GRANTEE | |
| type | ROLE_OWNER | |
| privilege | ROLE_NAME | |
| mapped login name | GRANTEE | |
| permission path | NULL |
Example code¶
Input code:¶
Generated Code:¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0004¶
Description¶
This message is shown when a BULK INSERT was transformed and a PUT command is added to the output code. It happens because the PUT command cannot be executed using the SnowSQL Web UI. To successfully execute it, any user should have the SnowCLI installed before.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
Install SnowCLI.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0005¶
TRY_CONVERT/TRY_CAST could not be converted to TRY_CAST
Description¶
This FDM is added when a TRY_CONVERT or TRY_CAST cannot be converted to a TRY_CAST in Snowflake.
Snowflake’s TRY_CAST function has a limitation as it only allows the conversion of string expressions. However, Transact’s TRY_CONVERT and TRY_CAST functions allow any data type expression.
Currently, the transformation from TRY_CONVERT or TRY_CAST to Snowflake’s TRY_CAST is only performed for string expressions or expressions that the tool can identify as strings in its context.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0006¶
EXECUTE AS ‘user_name’ clause does not exist in Snowflake and the user calling the procedure should have all the required privileges.
Description¶
This message is shown when SnowConvert AI finds a procedure with an EXECUTE AS 'user_name' clause. This is not supported in Snowflake, so it is changed EXECUTE AS CALLER.
This clause specifies the security context under which to execute the procedure.
Note
For more details see the documentation (https://learn.microsoft.com/en-us/sql/t-sql/statements/execute-as-clause-transact-sql?view=sql-server-ver16&tabs=sqlserver) about the clause functionality.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0007¶
FOR REPLICATION clause does not exist in Snowflake.
Description¶
This message is shown when SnowConvert AI finds a procedure with a FOR REPLICATION clause. This is not supported in Snowflake, so it is removed.
This clause specifies that the procedure is created for replication. Consequently, it can’t be executed on the Subscriber.
Note
For more details see the documentation (https://learn.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql?view=sql-server-ver16#for-replication) about the clause functionality.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0008¶
FORMATMESSAGE function was converted to UDF
Description¶
This Warning is added because the FORMATMESSAGE function is being used and it was replaced by FORMATMESSAGE_UDF. The reason to add the warning is because the FORMATMESSAGE_UDF used to replace the FORMATMESSAGE does not handle properly all kinds of formats and it may throw an error on certain conditions.
Unsigned numerical values that are given as negative will preserve the sign instead of converting the value. Also, the %I64d placeholder is not supported by the UDF so it will throw an error when it is used.
In the FORMATMESSAGE_UDF, an error will happen if the given number of arguments is different than the number of placeholders.
This UDF does not support using message number IDs.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
Avoid using
%I64dplaceholder in the message.Use directly the message as a string instead of using a message ID for the first argument.
Make sure the number of placeholders is the same as the number of arguments after the message.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0009¶
Encrypted with not supported in Snowflake.
Description¶
This warning is added when there is an ENCRYPTED WITH used in a Column Definition. Since this is not supported in Snowflake, it is being removed and a warning is added.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0010¶
CURRENT_DATABASE function has different behavior in certain cases.
Description¶
This EWI is added when the function DB_NAME is transformed to CURRENT_DATABASE because Snowflake does not support the database_id parameter and the CURRENT_DATABASE function will always return the current database name.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0011¶
Default value not allowed in Snowflake.
Note
This FDM is deprecated, please refer to SSC-EWI-TS0078 documentation
Description¶
This error is added to the code when expressions like function calls, variable names, or named constants follow the default option.
Snowflake only supports explicit constants like numbers or strings.
Code Example¶
Input Code:¶
Generated Code:¶
¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0012¶
Information for the column was not found. STRING used to match CAST operation
Description¶
This EWI is added in Table-Valued User Defined Functions where the return type of a column can not be determined during the conversion. STRING is used as a default to match the CAST operation in the SELECT statement <!–TODO: search for a broken reference.->
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
The user should check which is the correct data type that could not be found and change it in the
RETURNS TABLEstatement definition.If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0013¶
Snowflake Scripting cursor rows are not modifiable.
Description¶
This EWI is added when Cursors are open to modification in the input code. Snowflake Scripting does not allow modifying cursor rows.
Example Code:¶
Input Code:¶
Generated Code:¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0014¶
Computed column transformed
Description¶
This warning is added when an SQL Server computed column is transformed to its Snowflake equivalent. It is added because, in some cases, the functional equivalence could be affected.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required; it is just informative.
Add manual changes to the not-transformed expression.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0016¶
XML columns in Snowflake might have a different format
Description¶
This warning is added when an SQL Server FOR XML clause is transformed to its Snowflake equivalent. It is added because columns in XML could be different.
Code Example¶
Given the following table called employee as an example.
Id |
Name |
Hint |
|---|---|---|
1 |
Kinslee Park |
Developer |
2 |
Ezra Mata |
Developer |
3 |
Aliana Quinn |
Manager |
Input Code:¶
Code¶
Output¶
Generated Code:¶
Code¶
Output¶
Best Practices¶
No additional user actions are required; it is just informative.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0017¶
CURRENT_USER function does not support a user ID as a parameter.
Description¶
This EWI is added when functions like SUSER_NAME or SUSER_SNAME contain the user identifier as a parameter because this last one is not supported in the CURRENT_USER function in Snowflake.
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0018¶
Database console command is not supported
Note
This FDM is deprecated, please refer to SSC-EWI-TS0079 documentation
Description¶
This FDM is added when SnowConvert AI finds a DBCC statement inside the input code.
Most DBCC statements are not supported in Snowflake.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
No additional user actions are required; it is just informative.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0019¶
RAISERROR Error Message may differ because of the SQL Server string format.
Description¶
This EWI is added to notify that the RAISERROR Error Message may differ because of the SQL Server string format.
Code Example¶
Input Code:¶
Generated Code:¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0020¶
Default constraint was commented out and may have been added to a table definition.
Description¶
This FDM is added when the default constraint is present in an Alter Table statement.
Currently, support for that constraint is unavailable. A workaround to transform it is to define the table before using Alter Table. This allows SnowConvert AI to identify the references, and the default constraint is consolidated in the table definition. Otherwise, the constraint is only commented out.
Code Example¶
Input Code:¶
Generated Code:¶
Known Issues¶
When different default constraints are declared over the same column, only the first will be reflected on the Create Table Statement.
When a default constraint is declared on a missing column, the transformation cannot be performed due to the lack of dependencies.
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0021¶
A MASKING POLICY was created as a substitute for MASKED WITH.
Note
Some parts of the output code are omitted for clarity reasons.
Description¶
This EWI is added when the Alter Table statement contains a MASKED WITH clause. The reason this is added is to inform that an approximate MASKING POLICY was created as a substitute for the MASKED WITH function.
Code Example¶
Input Code:¶
Generated Code:¶
Note
The MASKING POLICY will be created previous to the ALTER TABLE statement. And it is expected to have an approximate behavior. Some tweaks might be needed in regard to roles and user privileges.
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0022¶
The user must previously define the masking role.
Note
Some parts of the output code are omitted for clarity reasons.
Description¶
This is EWI occurs when a MASKING POLICY is created and a role or privilege must be linked to it so the data masking could work properly.
Code Example¶
Input code¶
Generated Code:¶
Note
As shown on line 6, there is a placeholder where the defined roles can be placed. There is room for one or several values separated by commas. Also, here, the use of single quotes is mandatory for each of the values.
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0023¶
Error function could be different in Snowflake
Description¶
This EWI is added in the transformation of the following ERRORs functions due to the corresponding behavior change.
ERROR_MESSAGE The message of SQLERRM could be different in Snowflake.
ERROR_STATE The target SQLSTATE property could return a different number due to platform differences.
ERROR_PROCEDURE Transformation changed to return the stored procedure where the function is called.
Input Code:¶
Generated Code¶
Recommendation¶
If you need more support, you can email us at snowconvert-support@snowflake.com.
SSC-FDM-TS0024¶
CURRENT_TIMESTAMP in At Time Zone statement may have a different behavior in certain cases.
Description¶
This FDM is added when the At Time Zone has the CURRENT_TIMESTAMP. This is because the result might differ in some instances.
The main difference is that in SQL Server, CURRENT_TIMESTAMP returns the current system date and time in the server time zone and in Snowflake CURRENT_TIMESTAMP returns the current date and time in the UTC (Coordinated Universal Time) time zone.
Input Code:¶
Sql Server¶
Result¶
2024-02-08 16:52:55.317 -10:00
Generated Code:¶
Snowflake¶
Result¶
2024-02-08 06:53:46.994 -1000
Best Practices¶
This is an example if you want to keep the same format in Snowflake.
SQL Server¶
Result¶
2024-02-08 16:33:49.143 -10:00
In Snowflake you can use ALTER SESSION to change the default time zone. For example:
Snowflake¶
Result¶
2024-02-08 16:33:49.143
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0025¶
DB_ID_UDF may have a different behavior in certain cases.
Description¶
This FDM is added to clarify that the DB_ID_UDF tries to emulate the DB_ID (https://learn.microsoft.com/en-us/sql/t-sql/functions/db-id-transact-sql?view=sql-server-ver16) SqlServer function as well as possible. In SqlServer, the identifier assigned to a database is unique, and if the database is deleted, this ID won’t ever be used again; otherwise, in Snowflake, this identifier corresponds to the number assigned to the database when it is created; it is also unique, but it is a consecutive number which means that if this database is deleted, this number is going to be assigned to the database that was created after the deleted one.
Input Code:¶
Sql Server¶
Result¶
6
Generated Code:¶
Snowflake¶
Result¶
6
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0026¶
DELETE case is not being considered in the temporary table
Description¶
There is an INSERT statement pattern that requires a specific transformation, which involves the creation of a temporary table. This FDM notifies that the DELETE case is not considered in the transformation mentioned. Please visit INSERT with Table DML Factor with MERGE as DML to get more information about this pattern.
Input Code:¶
Sql Server¶
Generated Code:¶
Snowflake¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0027¶
SET ANSI_NULLS ON statement may have a different behavior in Snowflake
Description¶
This FDM notifies that the SET ANSI_NULLS ON statement may behave differently in Snowflake. For more information about this statement, go to the ANSI_NULLS article.
Input Code¶
Generated Code¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0028¶
Output parameters must have the same order as they appear in the executed code
Description¶
This FDM notifies that the output parameters in the SP_EXECUTESQL statement must be in the same order as they appear in the SQL string to execute. Otherwise, the output values will not be correctly assigned.
Code Example¶
Correct case¶
As can be seen, @MaxAgeOUT and @MaxIdOUT appear in the same order in both the SQL string and the output parameters.
Thus, when converting the code, the SELECT $1, $2 INTO :MAXAGE, :MAXID FROM TABLE(RESULT_SCAN(LAST_QUERY_ID())) will assign the values correctly.
Transact¶
Snowflake¶
Problematic case¶
As can be seen, @MaxAgeOUT and @MaxIdOUT in the output parameters appear in a different order compared to the SQL string.
Thus, when converting the code, the SELECT $1, $2 INTO :MAXID, :MAXAGE FROM TABLE(RESULT_SCAN(LAST_QUERY_ID())) will assign the values incorrectly. Max(AGE) will be assigned to :MAXID and Max(ID) to :MAXAGE.
This needs to be manually fixed by either changing the order of the output parameters in the SELECT INTO statement or by changing the order in the SQL string.
Transact¶
Snowflake¶
Best Practices¶
Make sure the OUTPUT parameters are in the same order as they appear in the SQL string.
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0029¶
SET NOCOUNT statement is commented out, which is not applicable in Snowflake.
Description¶
When SnowConvert AI encounters a SET NOCOUNT statement, it adds this FDM. SnowConvert AI then comments out the SET NOCOUNT statement because it is not relevant in the Snowflake environment.
Code example¶
Input Code:¶
Generated Code¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0030¶
SET ANSI_PADDING ON statement is commented out, which is equivalent in Snowflake.
Description¶
Snowflake always preserves trailing spaces in string values when they are inserted into columns. This behavior is equivalent to SET ANSI_PADDING ON in SQL Server. Therefore, when SnowConvert AI encounters a SET ANSI_PADDING ON statement, it adds this FDM and comments it out.
Code example¶
Input Code:¶
Generated Code¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0031¶
SET ANSI_WARNINGS ON statement is commented out because Snowflake generally adheres to ANSI-standard behaviors.
Description¶
Snowflake generally behaves as if ANSI_WARNINGS is ON by default, especially concerning error handling for arithmetic overflow, division by zero, and string truncation. You typically don’t need to explicitly “set” an equivalent to ANSI_WARNINGS in Snowflake. Therefore, when SnowConvert AI encounters a SET ANSI_WARNINGS ON statement, it adds this FDM and comments it out.
Code example¶
Input Code:¶
Generated Code¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0032¶
IDENTITY column property not supported in CREATE TABLE AS STATEMENT, emulated using ROW_NUMBER().
Description¶
Snowflake does not have a direct way to perform a CREATE TABLE AS with an identity column. Although SnowConvert adds a ROW_NUMBER column instead of the IDENTITY to simulate the enumeration of the identity. This transformation does not create an identity column, which means rows inserted after creation won’t be automatically incremented.
Code example¶
Input Code:¶
Generated Code¶
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0033¶
SET QUOTED_IDENTIFIER STATEMENT MAY HAVE A DIFFERENT BEHAVIOR IN SNOWFLAKE.
Description¶
SQL Server Behavior
In SQL Server, SET QUOTED_IDENTIFIER ON is a syntax setting that is separate from collation. The database’s or column’s collation (for example, _CI for Case-Insensitive or _CS for Case-Sensitive) dictates whether quoted identifiers are case-sensitive or not. If a database has a _CI collation, then “MyColumn” and “mycolumn” are treated as the same.
Snowflake Behavior
In Snowflake, the behavior is simpler and more strict:
Unquoted Identifiers: Automatically stored and resolved in all uppercase, making them case-insensitive (mytable is the same as MYTABLE).
Quoted Identifiers: By default, identifiers enclosed in double quotes (“MyColumn”) are case-sensitive. They are stored exactly as you typed them.
Code example¶
Input Code:¶
Generated Code¶
How to Achieve Equivalence in Snowflake
To get the same case-insensitive behavior for quoted identifiers as in SQL Server, you can set the QUOTED_IDENTIFIERS_IGNORE_CASE session parameter to TRUE in Snowflake.
Best Practices¶
If you need more support, you can email us at snowconvert-support@snowflake.com
SSC-FDM-TS0034¶
Description¶
This FDM is generated when a DATA_COMPRESSION clause is encountered in a CREATE TABLE or ALTER TABLE statement. In SQL Server, DATA_COMPRESSION is used to specify whether data should be compressed (using ROW or PAGE compression) to reduce storage space and improve I/O performance. Snowflake automatically handles data compression using its proprietary compression algorithms, making the DATA_COMPRESSION clause unnecessary and unsupported. SnowConvert comments out the DATA_COMPRESSION clause during conversion.
Example Code¶
Input (SQL Server):¶
Output (Snowflake):¶
If you need more support, you can email us at snowconvert-support@snowflake.com