Solved

Pass Table Name Parameter to a Script Action

  • 13 May 2021
  • 1 reply
  • 34 views

I have a generic stored procedure that does some custom post processing based on the table that has just been reloaded (Executed).  The stored procedure takes a parameter "TableName".  I've created a Script Action that executes the stored procedure.  I need this Script Action to run as a Post Step after the last execution step is run for one of several tables.  I can create one script action per table with the tablename hardcoded, but I've got a lot of tables to work with and would really prefer do this as a parameter containing the current table name.  Is the currently executing table name available in a system parameter somewhere and/or is there a way to create one that can be referenced by a script action?

icon

Best answer by JTreadwell 13 May 2021, 20:56

View original

1 reply

Userlevel 3
Badge +5

Hi Larry, the below solution is about as close as you can get to what you are looking for: 

  1. Create a SQL Snippet & parameterize the TableName in the snippet.
  2. Create a script action from the SQL snippet, and map the table to the parameter once for that snippet. (this will replace all instances of the parameter with the actual table name) Just be sure you specify the table variant (Raw or Valid table).
  3. Repeat step 2 for each table.

 

Reply