Hi, Can someone please tell me if and how I can execute a SQL server 2000 DTS package via .NET?
Thanks in advance
MarkusJ
Printable View
Hi, Can someone please tell me if and how I can execute a SQL server 2000 DTS package via .NET?
Thanks in advance
MarkusJ
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
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
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.
Cool, thanks for your help
MarkusJ