Groups | Blog | Home
all groups > sql server dts > november 2006 >

sql server dts : Turning off a Service using DTS


Chris
11/11/2006 11:43:02 AM
I have a dilema I cannot figure out.

I need to run a step in a DTS package that checks a count in a table. If the
count does not meet my criteria I need it to error out and run a batch file
to turn off a service on a different server.

I have tried running another DTS package (shelling out a cmd) on the server
where the service lives. I can get the the package to run but it will not
turn off the service.

I have also tried to run the batch file (shelling out a cmd) to turn the
service off as well. The batch file lives on the server where the service
needs to be turn off but it will not turn it off.

If I run the DTS package that I am shelling outm on the server where the
service lives it works fine.

Can any one give any insight into this?

Dave Patrick
11/11/2006 2:19:23 PM
You might try sc.exe with a fully qualified path.

sc.exe \\servername stop "service name"

also try;
http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/PsService.mspx


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

[quoted text, click to view]
|I have a dilema I cannot figure out.
|
| I need to run a step in a DTS package that checks a count in a table. If
the
| count does not meet my criteria I need it to error out and run a batch
file
| to turn off a service on a different server.
|
| I have tried running another DTS package (shelling out a cmd) on the
server
| where the service lives. I can get the the package to run but it will not
| turn off the service.
|
| I have also tried to run the batch file (shelling out a cmd) to turn the
| service off as well. The batch file lives on the server where the service
| needs to be turn off but it will not turn it off.
|
| If I run the DTS package that I am shelling outm on the server where the
| service lives it works fine.
|
| Can any one give any insight into this?
|
| Thanks for all of your help

Chris
11/11/2006 4:09:01 PM
Cool, thanks. I think this is exactly what I am looking for.



[quoted text, click to view]
Dave Patrick
11/11/2006 5:13:03 PM
Good to hear. You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

[quoted text, click to view]
| Cool, thanks. I think this is exactly what I am looking for.

AddThis Social Bookmark Button