Add a script variable

Use the procedure in this topic to add a script variable.

It is best practice to use the Transformation Designer to add and delete variables, as the script has to be changed accordingly. To change the value of a variable you can either do so within the Transformation Designer or use a text editor to edit the external script variables XML file.

If you edit the XML file outside of the Transformation Designer, you need to ensure that it is saved in UTF-8 format. If you use Notepad and save it as ANSI, it can corrupt the XML file.

Procedure

  1. On the Ribbon Project tab, in the Configuration group, select Script Variables Script Variables icon.

    The Script Variables window is displayed.

  2. Select Add Add icon.

    An editable variable is added to the table where the default name is "Variable <n>," where <n> is a unique number. This ensures that no two variables have the same name.

  3. Enter a Name for the new script variable.
  4. Select the Value column for the new field and enter a value for the variable.

    The script variable is a string type, so the variable is saved as a string.

  5. Select OK to save your changes and close the Script Variables window.
  6. Save the changes to your project.