Using Data Transformation Services: Using Global Variables with the DTS Designer
(Page 1 of 5 )
If you have ever wanted to create and use variables with global scope with the Microsoft DTS designer, this is the article for you. Two examples are used to illustrate the process, which involve deleting and updating records.
This tutorial deals with creating and using variables with global scope by utilizing the DTS designer. During package creation it is possible to create variables and assign them values that will have global scope. Variables with global scope created at design time can be used at run time while executing a package. For example, you can modify the data using global variables in a where clause. If a package is saved with the global variables defined and assigned, it will retain the value so defined. Using ActiveX scripts, it is possible to define a global variable at run time by defining the variable outside of a function. When a variable is defined inside a function, it will have only a procedural scope, unavailable after the function.
In Microsoft DTS, there are two ways to create/use global variables. It could be carried out at design time by specifying in the DTS designer (which is the gist of this tutorial) and dynamically by using ActiveX script, or by using the dtsrun utility with the /A command switch to define the variable.
Creating and using the global variables will be illustrated in this article with two examples outlining the major steps involved. It is suggested that the reader review the previous DTS tutorials at the ASP Free site (http://www.aspfree.com).
Next: First example: Deleting Records >>
More MS SQL Server Articles
More By Jayaram Krishnaswamy