SnowConvert AI - SQL Server

What is SnowConvert AI for SQL Server?

SnowConvert AI is a software that understands SQL Server scripts and converts this source code into functionally equivalent Snowflake code.

변환 유형

Specifically, SnowConvert AI for SQL Server performs the following conversions:

SQL 서버에서 Snowflake SQL 로 변환

SnowConvert AI understands the SQL Server 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.

샘플 코드

SQL 서버 기본 입력 코드:

CREATE TABLE Persons (
    PersonID int,
    LastName varchar(255),
    FirstName varchar(255),
    Address varchar(255),
    City varchar(255)
);
Copy

Snowflake SQL 출력 코드:

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":"transact"}}'
;
Copy

보시다시피 대부분의 구조는 동일하게 유지됩니다. 예를 들어, 데이터 타입을 변환해야 하는 경우가 있습니다.

SQL 서버 저장 프로시저에서 JavaScript 임베드 Snowflake SQL 로

SnowConvert AI takes SQL Server stored procedures and converts them to JavaScript embedded into Snowflake SQL. SQL Server’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.

샘플 코드

SQL 서버 기본 저장 프로시저:

CREATE PROCEDURE SelectAllCustomers
AS
SELECT * FROM Customers
GO;
Copy

Snowflake SQL 출력 코드, 내장 JavaScript 포함:

-- 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 AI Helpers Code
   // END REGION

EXEC(`SELECT
   *
FROM
   Customers`);
$$;

!!!RESOLVE EWI!!! /*** SSC-EWI-0040 - THE STATEMENT IS NOT SUPPORTED IN SNOWFLAKE ***/!!!
;
Copy
  • JavaScript 코드를 생성할 때 프로시저의 내용을 쉽게 변환하기 위해 _helper_로 추가되는 코드가 있는데, 이는 프로시저의 내용을 쉽게 변환하기 위해 필수입니다.

  • 변환된 코드에서 어떤 일이 발생하는지 확인할 수 있도록 관련 코드와 함께 경고가 표시될 수 있습니다. (문제 및 문제 해결 참조)

SnowConvert AI Terminology

이러한 코드 변환의 마법에 빠져들기 전에 몇 가지 용어/정의에 대한 설명서를 통해 그 의미를 이해할 수 있도록 몇 가지 용어를 소개합니다.

  • SQL (구조화된 쿼리 언어): 대부분의 최신 데이터베이스 아키텍처에서 데이터를 저장, 조작, 검색하기 위한 표준 언어입니다.

  • SnowConvert AI: the software that converts securely and automatically your SQL Server files to the Snowflake cloud data platform.

  • Conversion rule or transformation rule: rules that allow SnowConvert AI to convert from a portion of source code to the expected target code.

  • Parse: parse or parsing is an initial process done by SnowConvert AI to understand the source code and build up an internal data structure required for executing the conversion rules.

On the next few pages, you’ll learn more about the kind of conversions that SnowConvert AI for SQL Server is capable of. If you’re ready to get started, visit the Getting Started page in this documentation.