Insert
Translation reference for SQL Server Insert statement to Snowflake
Some parts in the output code are omitted for clarity reasons.
Description
Adds one or more rows to a table or a view in SQL Server. For more information regarding SQL Server Insert, check here.
Syntax comparison
The basic insert grammar is equivalent between both SQL languages. However there are still some other syntax elements in SQL Server that show differences, for example, one allows the developer to add a value to a column by using the assign operator. The syntax mentioned will be transformed to the basic insert syntax too.
For information about other special syntax elements in SQL Server like the ones shown in the below example please refer to the Known Issues section of this page.
Snowflake
SQL Server
Sample Source Patterns
Basic INSERT
SQL Server
Snowflake
INSERT with assing operator
SQL Server
Snowflake
INSERT with no INTO
SQL Server
Snowflake
INSERT with common table expression
SQL Server
Snowflake
Known Issues
1. Syntax elements that require special mappings:
[INTO]: This keyword is obligatory in Snowflake and should be added if not present.
[DEFAULT VALUES]: Inserts the default value in all columns specified in the insert. Should be transformed to VALUES (DEFAULT, DEFAULT, ...), the amount of DEFAULTs added equals the number of columns the insert will modify. For now, there is a warning being added.
SQL ServerIN -> SqlServer_05.sqlSnowflakeOUT -> SqlServer_05.sql
2. Syntax elements not supported or irrelevant:
[TOP (expression) [PERCENT]]: Indicates the amount or percent of rows that will be inserted. Not supported.
[rowset_function_limited]: It is either OPENQUERY() or OPENROWSET(), used to read data from remote servers. Not supported.
[WITH table_hint_limited]: These are used to get reading/writing locks on tables. Not relevant in Snowflake.
[<OUTPUT Clause>]: Specifies a table or result set in which the inserted rows will also be inserted. Not supported.
[execute_statement]: Can be used to run a query to get data from. Not supported.
[dml_table_source]: A temporary result set generated by the OUTPUT clause of another DML statement. Not supported.
Related EWIs
Last updated