Skip to content

SQL Script

The SQL script can contain multiple SQL statements. However, since there is no way to recover the output of the script, the statements should not be SELECT. If you wish to write SELECT queries, the SQL transformation component allows for custom SELECT statements where the output can be used as part of the transformation flow.

There is no guarantee that multiple SQL statements will always run in the same session.

It is advised to avoid using transaction control statements such as commit or rollback in your scripts.

The Designer executes each query within an SQL Script component using a connection from a connections pool, meaning that each query may be executed by a different connection. When connections in the pool are first created, they will use the Snowflake warehouse that you have defined as the default in the environment configuration.

Designer automatically saves your SQL statements as you work. You can sample data and view variables while writing your SQL statments in the SQL Script field.


Properties

Script Location = drop-down

  • Component: Use the SQL Script property to add your SQL statements to this component. This is the default setting.
  • File: Use the Select File property to choose a .sql file in your project. The drop-down will list all .sql files from the repository that is connected to your project.

SQL Script = code editor

Add your SQL script into the code editor. This script is stored in the component.


Select File = drop-down

Choose a .sql file in your project to run via this component. The drop-down will list all .sql files from the repository that is connected to your project.

Double-click a .sql file in the Files panel to open that .sql file in the code editor.


Snowflake Databricks Amazon Redshift