Article ID: 315661 - Last Review: August 4, 2005 - Revision: 5.3 How to run a SQL Server Data Transformation Services package from Visual BasicThis article was previously published under Q315661 On This PageSUMMARY Data Transformation Services (DTS) is a set of tools that
you can use to export, to import, and to transform data between one or more
data sources, such as Microsoft SQL Server or Microsoft Access, using OLE DB to
provide connectivity. You can run a SQL Server DTS package from SQL Server Enterprise Manager by using the dtsrun command from a command prompt or by using SQL Server Agent to schedule the execution. These methods allow you, as an administrator, to run packages as required or at predetermined times. However, you may sometimes want to allow users to run packages, but the users might not have access to or knowledge of the SQL Server tools. In this situation, you may want to run a DTS package from another application. This article demonstrates how you can run a SQL Server DTS package from within a Visual Basic application by using the DTSPackage Object Library. Not only can you run packages that are stored on a computer that is running SQL Server, in the repository, or from a file, but you can also create and modify packages by using this library. Create a sample DTS packageCreate a sample DTS package that, for the purposes of this article, is named DTSDemo.For more information about how to create a DTS package see: SQL Server Books Online "Creating DTS Packages in Visual Basic" "DTS Packages in Visual Basic" "Creating a Package with DTS Designer" "Creating a DTS Package with the DTS Import/Export Wizard" Install SQL Server client componentsYou must install the SQL Server client components installed on the Visual Basic development computer, if they are not installed already. This will install (among other things) the DTSPackage Object Library.You do not have to perform this step if you have all the client components installed on your development computer. For more information about how to install only the client components see: SQL Server 2000 Books Online "How to Install Client Tools Only (Setup)" SQL Server 7.0 Books Online "How to Install Client Connectivity Components (Setup)" Create a Visual Basic application that executes a DTS package
Run the applicationRun the Visual Basic application, and then click the command button. The DTS package is loaded and executed on the server where it will generate a text export file named DumpData.txt in the root of the C drive on the computer on which SQL Server is running. This is the location that you specified when you created the package, and you can only change it by editing the package in SQL Server.REFERENCES For more information about running DTS packages by using
Visual Basic, see the following topics in SQL Server Books Online:
252987
(http://support.microsoft.com/kb/252987/
)
Execute a SQL Server DTS package from Active Server Pages
242391
(http://support.microsoft.com/kb/242391/
)
DTS package development, deployment and performance
221193
(http://support.microsoft.com/kb/221193/
)
How to install Data Transformation Services (DTS) event handlers in Visual Basic
APPLIES TO
| Article Translations
|
Back to the top
