Page tree


Our documentation site is moving!

For up-to-date documentation of Dataprep, please visit us at


Feature Availability: This feature may not be available in all product editions. For more information on available features, see Compare Editions.

When specifying on-demand or scheduled outputs, you can define SQL scripts to execute before data ingestion, after output publication, or both. These scripts can be executed through any database connection to which you have write access.

NOTE: This feature may need to be enabled by an administrator. 

When specifying your output, you can choose to add SQL scripts. 

Figure: SQL Scripts panel


  • Connection: The name of the connection where the script is to be executed.
  • SQL statement: The first part of the SQL statement to be executed.
  • Settings:
    • Run before data ingest: during job execution, script is to be run before data is ingested for job execution.
    • Run after data publish: during job execution, script is to be run after job has been executed and data is published. 

      NOTE: If publishing job fails, then all downstream tasks also fail, including the SQL script, which is not executed and is recorded as a failed phase of the job execution.


  • Add Script: To add a new SQL script for this output, click Add Script. See below.
  • Edit: To modify the SQL script, highlight the entry and click Edit.
  • Delete: To removal the SQL script, highlight the entry. Then, click More menu > Delete.

Add SQL Script Window

Enter your SQL statement in the window.

Figure: Add SQL Script window


  1. Select the connection through which to apply the SQL statement. 
  2. Enter your SQL statements in the window:

    NOTE: Each line must end with a semi-colon (;). Validation fails if otherwise.

    1. You may enter multi-statement SQL scripts.

    2. SQL lines in an individual script are executed in the order listed in the script.

    3. Your SQL statements must comply with the expected syntax of the target system. For more information, see Supported SQL Syntax.

  3. Choose when to run the SQL script:

    1. Run before data ingest: SQL script is executed before the data is ingested for a job run.

    2. Run after data publish: SQL script is executed after that data has been published from a job run.

  4. To validate your SQL, click Validate SQL

  5. To add the SQL script, click Add

If you have defined multiple scripts of the same type (before data ingest, for example), those scripts may be executed in parallel. 

NOTE: The order of listing of scripts in the Dataprep by Trifacta application does not affect the order of execution of those scripts.

For more information on managing SQL scripts, see Create Output SQL Scripts.

This page has no comments.