how to call DTS wizard in windows application

In my windows application, I want to pick a file (csv) and import to the SQL database. Just like what DTS wizard does. Is that an easy way to import csv file append a pre-existing SQL server table or just call DTS wizard from an application  

Thanks


Answer this question

how to call DTS wizard in windows application

  • Frank H. Shaw

    if the csv file is in the same format each time you can use the dts wizard to create a package and save it then call the command line dts utility and wait for it to finish like the following:

            Dim DTS_Process As New System.Diagnostics.Process
            DTS_Process = Process.Start("C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtsrun.exe", "/E /S127.0.0.1 /NYOUR_DTS_PACKAGE_NAME")
            DTS_Process.WaitForExit()

    You can do a dtsrun /  from the command prompt for more info on dtsrun.

  • Jerry Cheng

    you can also call it via SQL 

    exec objectID

    for example lets say the object id (which is a guid) is 324-343-3434-45

    Then it would be something like
    exec 324-343-3434-45

    Hope this helps. 

    Joe

  • Beemer

    NO!@#

    There isn't an easy way, you need to use the DTS object and build your own wizard. then run the package.

    This will give you some clues

    http://www.planet-source-code.com/vb/scripts/ShowCode.asp txtCodeId=1568&lngWId=10

    Welcome to @#@$

    Joe

  • how to call DTS wizard in windows application