Data Transformation Services (DTS) were added to SQL Server 7 and allow us to combine several data-related tasks into one common object. In this article Tim shows us how to create a DTS package with SQL Server 2000 that will access a database and email the results of a query to some sales executives. He also shows us how to execute and error trap DTS packages from within an ASP script.
Creating DTS Packages With SQL Server 2000 (Page 1 of 6 )
Back in the days when Microsoft SQL Server 6.5 was still hot property, the bulk copy program was the only way to backup or export databases from SQL Server to other data sources, such as other database servers or text files. DBA's (Database Administrators) would spend hours setting up and automating backup scripts for each server, and it wasn't until the release of SQL Server 7 that Microsoft finally gave DBA's a set of drag and drop tools to accomplish this more quickly and easily. This set of tools is known as DTS (Data Transformation Services).
By creating DTS packages, we can combine several tasks into one process and use any programming language that supports automation (such as Visual Basic 6, ASP, or C++) to execute these packages and monitor their progress for errors, etc.
In this article I'm going to show you how to create a DTS package that retrieves sales data from a Microsoft SQL Server 2000 database and emails it to a fictitious list of company executives. We will take an in-depth look at creating the package, what tools we can use to make our job easier, and the details of the DTS.Package COM object, which we can use to execute a DTS package. We will also look at calling a DTS package from ASP.
To test the examples in this article, you should have access to a Windows 2000 web server running IIS version 5 (configured with an SMTP mail server), as well as SQL Server 2000. You should also be familiar with VBScript, ASP, and some basic SQL "INNER JOIN" syntax.