Wednesday, March 21, 2012

Job issue

Dear all,
I want to define a job which might be able to launch a .BAT where its
location is my local workstation. Is it possible? That .BAT call a .EXE and
we wish to keep out of our production server. That job will be scheduled fro
m
the server...
Thanks a lot,There are a couple of things to consider here. If you create the job on your
sql server, and have the first step be an OS Command (CmdExec) with a value
like
\\yourworkstation\c$\yourbatch.bat
-although the file resides on the machine yourworkstation, the program is
actually executed from the server (and since the exe that the bat file calls
won't be on the server, it will fail)
-if the sql server is running under the local system account, you won't be
able to connect over the network to your workstation anyway.
If you needed the program to physically reside and execute from your
workstation, you're best bet would be to create a scheduled task on your
workstation, and call the command from the sql server like
schtasks /run /tn YourTask /s yourworkstation
where YourTask is the name given to your task when you create it. If the sql
server is running under the local system account, you will need to specify a
user account that has local administrative priveledges on yourworkstation,
like so
schtasks /run /tn YourTask /s yourworkstation /u administrator /p password
The security implications here are that you have an administrator password
stored with the job on the sql server.
"Enric" wrote:

> Dear all,
> I want to define a job which might be able to launch a .BAT where its
> location is my local workstation. Is it possible? That .BAT call a .EXE an
d
> we wish to keep out of our production server. That job will be scheduled f
rom
> the server...
> Thanks a lot,

No comments:

Post a Comment