|
-
Oct 5th, 2002, 04:21 PM
#1
Thread Starter
Hyperactive Member
Executing a DTS package via .NET
Hi, Can someone please tell me if and how I can execute a SQL server 2000 DTS package via .NET?
Thanks in advance
MarkusJ
-
Oct 5th, 2002, 08:59 PM
#2
Hyperactive Member
well just pass the command text to execute the package to a command object:-
dim conn as new sqlclient.sqlconnection(connectionstring)
dim cmd as new sqlclient.sqlcommand(conn)
cmd.commandtype = CommandType.Text
cmd.commandtext = "command text to execute package"
try
conn.open
cmd.executenonquery
finally
conn.close
end try
-
Oct 5th, 2002, 10:42 PM
#3
Thread Starter
Hyperactive Member
Hi, I was actually wondering if there was a specific DTS function call in ADO.NET.
I did use the command object of SQLClient namespace but I do not know how to call the DTS package from the command text.
eg oCOmmand.commandtext="exec ??????"
just going "exec NameOfDTSpackage" implies that I am trying to call a stored procedure under SQL and not a DTS package.
Thanks again for your help
Cheers
MarkusJ
-
Oct 6th, 2002, 08:29 AM
#4
Hyperactive Member
Yeah I'm not familiar with the DTS object model and whether ADO.Net has an interface to it. I doubt it though. There is a stored procedure called sp_start_job which might do what you want. Just create a job in sql server agent to run your package.
-
Oct 14th, 2002, 06:41 PM
#5
Thread Starter
Hyperactive Member
Cool, thanks for your help
MarkusJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|