How to Execute a DTS Package with a Webpage
Data Transformation Services, or DTS, is a type of SQL Server application that lets you manipulate table information on your database server. You can call a DTS package from your Microsoft Web pages. Microsoft Web pages integrate with SQL Server so you can dynamically create Web pages and call SQL Server applications from user input. You can execute any DTS package on an SQL Server using a few lines of code.
Instructions
-
-
1
Click the Windows "Start" button and select "All Programs." Click "Microsoft .NET Platform," then click "Visual Studio." Double-click the project name on the opening screen to open your coding files.
-
2
Right-click on the form that you want to use to run the DTS package. Select "Code View" to open to the location where you place your DTS code.
-
-
3
Create the DTS package variable. You create a variable, which is used to execute the package and save your DTS values. Type the following code to create a variable:
Set package = Server.CreateObject("DTS.Package")
-
4
Execute the package. The "Execute" function runs the DTS package on your SQL Server. Type the following code:
package.LoadFromSQLServer "DatabaseServer","user","password",DTSSQLStgFlag_Default,"PackagePassword","","","PackageName"
package.Execute()
The first line of code specifies your database server name, the user name and password, and the DTS package name. The second line executes the DTS package.
-
5
Click "Run" in the Visual Studio toolbar to execute the DTS, and test your code. Click "Save" to save changes.
-
1