how to create DTS package from Visual Basic script

  • I was having issues getting a DTS package to do what was needed so I decided to use the 'save as' Visual Basic file option and modify the file directly. I have the script modified so that it should create the package the way it needs to be; I thought I could run that script in Query Analyzer to create the new package -- that doesn't work. Hopefully one of you will tell me where I am supposed to run the modified vb script to create the new package. The msdb database is SQL Server 2000. Thank you in advance for your assistance.

  • Open the file in Visual Basic.

    Add the following References to the VB project:

    Microsoft DTSPackage Object Library

    Microsoft DTS Custom Tasks Object Library

    Microsoft DTS Runtime 1.0

    Microsoft DTSDataPumpScripting Object Library

    You may not need all of them, but adding them all at once will prevent you from getting a "user-defined type not defined" error message.

    Search the .bas module for the section of code titled "Save or execute package".

    Uncomment the line that starts "goPackage.SaveToSQLServer" and comment out the line "goPackage.Execute".

    Run the project. Go back to the SQL Enterprise Manager and refresh the DTS packages view. You should see your new package.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply