SQL Script Dynamic Action

About

The SQL Script Action runs SQL scripts

Metadata tab

SQL Script Action - Metadata tab
 

  1. The Write Variables option ensures that the “Package Action” logs the variable values into the “Action vars before log file” before the action is executed and logs the updated variable values into the “Action vars after log file” after the action completes.
  2. This option is typically used for debugging and is not recommended in a production environment.
  3. It can be globally disabled through the options dialog .

Parameters tab

SQL Script Action - Parameters tab

Tips

  • The “Replace Variables” parameter is used to substitute variables within SQL statements.
  • When the “UseEmbeddedSQL” is set to True EmbeddedSQL is used, otherwise SQL Script/Lookup is used.
Sql Script Action - UseEmbeddedSQL Parameter

Selecting Script

SQL Script Action - Editing SQL Script Parameter

Editing Script

SQL Script Action - Editing SQL Embedded Script Parameter

Selecting Connection

SQL Script Action - Editing SQL Script Connection Parameter

Variables tab

The Variables tab defines which variables are updated during the execution of the action.

SQL Script Action - Variables tab

Execution log tab

The Execution Log tab is populated after the action has been executed. Double-click a row to view the detailed execution log.

Script Action - Execution log tab

Calculated parameters example

Pascal

SQL Script Action - Calculated Parameter example - Pascal
  Script

begin
 if DayOfWeek(Now)=3 then
    begin
     Result:=1917;
    end
 else
    begin
     Result:=1968;
    end;
end;

Python

SQL Script Action - Calculated Parameter example - Python
  Script

import datetime;
if datetime.datetime.today().weekday()==0:
   Result.Value=3917
else:
   Result.Value=3918
  1. Sql Script Action
  2. Sql Data Check Action
  3. Check Connection Action

For more technologies supported by our ETL Software see Advanced ETL Processor Versions

Confused? Ask question on our ETL Forum

Posted on November 14, 2025 • 2 min read • 259 words
www.etl-tools.com About Support Pricing Cookies Policy Term Of Use Privacy Policy License