Re: Running a program from a SQL job
From: Steen Persson (SPE_at_REMOVEdatea.dk)
Date: 06/14/04
- Next message: Hari: "Re: Create table with Encrypted passwords"
- Previous message: J Jetson: "Installing SQL SERVER 2000 Standard on Windows 2003 server"
- In reply to: Hari: "Re: Running a program from a SQL job"
- Next in thread: Hari: "Re: Running a program from a SQL job"
- Reply: Hari: "Re: Running a program from a SQL job"
- Reply: Tibor Karaszi: "Re: Running a program from a SQL job"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Jun 2004 15:26:49 +0200
Hi Hari
Thanks for the advise. I've just tried it, but it seems like it has the same
problem as when I run it un a job.
The commandline I'm running is : "c:\program files\7-zip\7z" a -tzip
filename.zip filename.mdc
This works fine when running it either as a bat file or just in a cmd
window, but from within SQL it seems to fail. The output I get from running
it either as a job or with the XP_CmdShell is :
NULL
7-Zip 2.30 Beta 28 Copyright (c) 1999-2003 Igor Pavlov 2003-02-16
Scanning
NULL
Updating archive filename.zip
NULL
NULL
Everything is Ok
NULL
It reports that everything is ok, but it just don't create the zip file. It
might be that this 7-zip program just can't run properly without having an
open cmd prompt - which of course is a bit weird.
Regards
Steen
"Hari" <hari_prasad_k@hotmail.com> skrev i en meddelelse
news:eCrlkGhUEHA.484@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> Use XP_CMDSHELL to fire a OS command from command prompt.
>
> Before commentng more, can you send out the script you are trying out.
>
> --
> Thanks
> Hari
> MCDBA
> "Steen Persson" <SPE@REMOVEdatea.dk> wrote in message
> news:uKWljChUEHA.1764@TK2MSFTNGP10.phx.gbl...
> > Hi
> >
> > I'm having a strange problem which puzzels me a little bit.
> > I have created a SQL job that can zip a file that has been generated
from
> a
> > provious job. I've made a bat file that contains the string to run to
zip
> > the file. When I run this bat file manually just by doubleclicking it,
it
> > runs fine and do the job. When I set the SQL job to execute the same bat
> > file, it executes the bat file, but the bat file doesn't zip the file.
It
> > reports that everything is ok, but the file isn't being created.
> >
> > It seems like the zip program I've found that can be executed from a
> command
> > line (it's a program called 7-zip) will only do the job if it can "open"
a
> > command prompt in the background which SQL apparently doesn't do.
> > My question is now if any of you know a way to let a SQL job "open" a
> > command prompt and then execute a program from there. It could also be
as
> > simple as using a different zip program. 7-zip was just one I found that
> > could zip a file from a command line.
> >
> > Regards
> > Steen
> >
> >
>
>
- Next message: Hari: "Re: Create table with Encrypted passwords"
- Previous message: J Jetson: "Installing SQL SERVER 2000 Standard on Windows 2003 server"
- In reply to: Hari: "Re: Running a program from a SQL job"
- Next in thread: Hari: "Re: Running a program from a SQL job"
- Reply: Hari: "Re: Running a program from a SQL job"
- Reply: Tibor Karaszi: "Re: Running a program from a SQL job"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|