WingYip
asked on
VB.Net and DTS
How do you execute a sql DTS transaction from VB.net.
Can anyone help?
Wing
Can anyone help?
Wing
Which version of SQL server are you running against?
I'll assume SQL 7.0 and continue. For SQL 2000 (SP3) there is a command-line utility that does what your looking for.
Add a project reference to 'Microsoft DTSPackage Object Library'. Then insert the following code:
Dim oPackage As DTS.Package = New DTS.Package( )
oPackage.LoadFromSQLServer ( _
ServerName:="{server-name} ", _
Flags:=DTS.DTSSQLServerSto rageFlags. DTSSQLStgF lag_UseTru stedConnec tion, _
PackageName:="{package-nam e}")
oPackage.Execute( )
oPackage.UnInitialize( )
oPackage = Nothing
You can use SQL server authentication as well, but what to do with the password !?
Flags:=DTS.DTSSQLServerSto rageFlags. DTSSQLStgF lag_Defaul t
Add a project reference to 'Microsoft DTSPackage Object Library'. Then insert the following code:
Dim oPackage As DTS.Package = New DTS.Package( )
oPackage.LoadFromSQLServer
ServerName:="{server-name}
Flags:=DTS.DTSSQLServerSto
PackageName:="{package-nam
oPackage.Execute( )
oPackage.UnInitialize( )
oPackage = Nothing
You can use SQL server authentication as well, but what to do with the password !?
Flags:=DTS.DTSSQLServerSto
ASKER
Thanks for the response it's sql 2k actually
Command line utility?
wing
Command line utility?
wing
>> Command line utility?
It's called dtsrun.
More information is available on the ms site.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/coprompt/cp_dtsrun_95kp.asp
It's called dtsrun.
More information is available on the ms site.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/coprompt/cp_dtsrun_95kp.asp
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: _ys_ {http:#9597107}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
TheLearnedOne
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: _ys_ {http:#9597107}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
TheLearnedOne
EE Cleanup Volunteer
ASKER
Sorry forgot to finish this one but I still have a question here.
How do you deal with the sql 2k dtsrun command line utility in vb.net?
Wing
How do you deal with the sql 2k dtsrun command line utility in vb.net?
Wing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
fantastic!
Wing
Wing
np.
Finally got it sorted ...
Finally got it sorted ...