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
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.
how to call DTS wizard in windows application
Frank H. Shaw
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
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
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