Saturday, February 25, 2012

CmdExec Jobs

Hello - I am trying to set up a job through sql server agent. The job sets
the osqluser and osqlpassword, then calls a bunch of batch files. When I ru
n
it in dos, it works great, but in the sql job, it does nothing. Does the
syntax need to be different or something'
SET uname=Uname
SET pword=Pword
osql -Ssrvname -i inputfile -n > d:\outputfile.txt
Thanks!
MitchYou can only execute one command in a CmdExec job step. Having several job s
teps will probably not
cut it as I guess that the SET settings won't be saved between job step exec
utions. Do the commands
in a bat file instead and schedule this bat file.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mitch" <Mitch@.discussions.microsoft.com> wrote in message
news:7848BB7E-494B-4F6D-B3A7-B5C2E71C4912@.microsoft.com...
> Hello - I am trying to set up a job through sql server agent. The job set
s
> the osqluser and osqlpassword, then calls a bunch of batch files. When I
run
> it in dos, it works great, but in the sql job, it does nothing. Does the
> syntax need to be different or something'
> SET uname=Uname
> SET pword=Pword
> osql -Ssrvname -i inputfile -n > d:\outputfile.txt
> Thanks!
> Mitch

No comments:

Post a Comment