-
Executing DTS packages
Does anyone know how to execute a DTS package from PHP? I'm using SQL Server 2K with PHP 4.3.8.
I've tried a few simple things in the query analyzer with no luck.
Any help/suggestions would be appreciated.
And in case you are wondering, I do have the package scheduled to go off every morning at 3AM, but I want to allow the user to run the update whenever they want.
-
Is it possible to launch a DTS from a SP?
-
From what I've read, it is. And I know how to run a SP, but I can't find the code on how to execute a DTS package from a SP.
-
I found an article some time ago on how to call COM objects from PHP. I have no idea where it was I saw it, and it doesn't look like I bookmarked it. I imagine that's the route you will need to go. Try googling "calling COM objects from PHP" and see what comes up.
-
You could use the xp_cmdshell procedure to run the command line utility DTSRun. Look up DTSRun in books online for syntax questions and give it a go.
-
I did try using that without luck. I couldn't find specific syntax on the BOL.
I tried "EXEC xp_cmdshell(dtsrun(nameofmydtspackage))"
But that didn't do it.
-
Try this:
Code:
xp_cmdshell 'dtsrun /SServerName /UUserID /PPassword /N"Package Name"'
Or you can go to sqldts.com and look at the FAQ on Execution for some tips.
-
Thanks a lot. I'll look into that. :)