Last updated
Last updated
SnowConvert is a software that understands Azure Synapse scripts and converts this source code into functionally equivalent Snowflake code.
Specifically, SnowConvert for Azure Synapse performs the following conversions:
SnowConvert understands the Azure Synapse source code and converts the Data Definition Language (DDL), Data Manipulation Language (DML), and functions in the source code to the corresponding SQL in the target: Snowflake.
Azure Synapse basic input code:
Snowflake SQL output code:
As you can see, most of the structure remains the same. There are some cases where the datatypes have to be transformed, for example.
SnowConvert takes Azure Synapse stored procedures and converts them to JavaScript embedded into Snowflake SQL. Azure Synapse's CREATE PROCEDURE is replaced by Snowflake's CREATE OR REPLACE PROCEDURE. JavaScript is called as a scripting language, and all of the inner statements are converted to JavaScript.
Azure Synapse basic stored procedure:
Snowflake SQL output code, with embedded JavaScript:
When creating the JavaScript code, there is a portion of code added as a helper, required for an easier transformation of the contents of the procedure.
Before we get lost in the magic of these code conversions, here are a few terms/definitions so you know what we mean when we start dropping them all over the documentation:
SQL (Structured Query Language): the standard language for storing, manipulating, and retrieving data in most modern database architectures.
SnowConvert: the software that converts securely and automatically your Azure Synapse files to the Snowflake cloud data platform.
Conversion rule or transformation rule: rules that allow SnowConvert to convert from a portion of source code to the expected target code.
Parse: parse or parsing is an initial process done by SnowConvert to understand the source code and build up an internal data structure required for executing the conversion rules.
You can expect to see warnings with an associated code to help you find out what is happening in the converted code. (See )
On the next few pages, you'll learn more about the kind of conversions that SnowConvert for SQL Server is capable of. If you're ready to get started, visit the page in this documentation.
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
CREATE OR REPLACE TABLE Persons (
PersonID INT,
LastName VARCHAR(255),
FirstName VARCHAR(255),
Address VARCHAR(255),
City VARCHAR(255)
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"azure synapse"}}'
;
CREATE PROCEDURE SelectAllCustomers
AS
SELECT * FROM Customers
GO;
-- Additional Params: -t JavaScript
CREATE OR REPLACE PROCEDURE SelectAllCustomers ()
RETURNS STRING
LANGUAGE JAVASCRIPT
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"transact"}}'
EXECUTE AS CALLER
AS
$$
// REGION SnowConvert Helpers Code
// END REGION
EXEC(`SELECT
*
FROM
Customers`);
$$;
!!!RESOLVE EWI!!! /*** SSC-EWI-0040 - THE STATEMENT IS NOT SUPPORTED IN SNOWFLAKE ***/!!!
;
Welcome to Snowflake SnowConvert for Azure Synapse. Let us be your guide on the road to a successful migration.