SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

More Portable DTS Packages

By Tito David, 2005/04/07

Total article views: 8976 | Views in the last 30 days: 26
MAKING DTS PACKAGES AND SQL JOBS PORTABLE

The popularity of DTS has continuously grown but it had and still has issues with portability. SQL 2000 offers a lot of alternatives to make DTS packages portable. I have tried the INI file approach and found that an INI file can only hold a limited amount of variables. The 'Query' Method, however, looks more promising.

This method requires a SQL Table that becomes a repository of connection variables. It can be as simple as a 2 column table, a common keyword and the actual substitution value. The table has to be in each Server Instance where the actual values can vary or be changed without editing the DTS Package; which is the strength of this method. Fig1 shows a snapshot of the table in the DEV instance.


Figure 1

To illustrate this method, I created a sample package that reads a Source table and writes to an Excel spreadsheet as shown in Fig2. On a typical development, you start out with defining the transformations after which you add the Dynamic Properties to make the Package portable.


Figure 2

To achieve portability, I will need to define the connection properties to Source and Target by looking them up from the GlobalVars Table. The challenge is that the connection to the Lookup Table needs to be predefined and this is overcome through another Dynamic Properties (Link2GlobalVars) task as shown in Fig3 .


Figure 3

Fig3 shows the need to make a local connection to the lookup table, GlobalVars, at execution time. This is done with the SELECT SERVERPROPERTY('SERVERNAME') query as shown in Fig4.


Figure 4

From here on, the next Dynamic Properties (Source2TargetConn) task defines the connection to Source and Target as shown in Fig5 and Fig6. At execution time, the connections can vary depending on the values present at the local Lookup Table, GlobalVars.


Figure 5


Figure 6

Deploying the DTS Package then becomes a breeze, with a right click on the white space and saving it to any Target Server. To complete the solution, the SQLAgent job that executes the package can likewise be made portable as shown in Fig7.


Figure 7

The dot notation on the DTSRUN command designates that it is to run on the local server. The SQL Job can be scripted and installed in any Target Server with little or no modifications.

By Tito David, 2005/04/07

Total article views: 8976 | Views in the last 30 days: 26
Your response
 
 
Related tags

DTS    
SQL Server 7, 2000    
 
Related content

Locking Down DTS

By Brian Knight | Category: DTS
| 8,008 reads

DTS Basics

By Brian Knight | Category: DTS
| 10,172 reads
Like this? Try these...

Automating DTS Execution

By Augustin Carnu | Category: DTS
| 9,908 reads

The Multi Phase Data Pump

By Dinesh Asanka | Category: DTS
| 11,335 reads

Flexible DTS Packages with Perl

By Jeremy Brown | Category: DTS
| 10,200 reads
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com