Hi Folks,
I'm trying to find a way to get access to the STATS output from the BACKUP
command during automated backups.
When running the BACKUP command in QA it shows the output, line by line, as
the backup progresses. Is there any way I can get this information when the
BACKUP statement is run from a job? I thought the console tool might have
been the answer, but it doesn't show any progress messages.
Is the only option to use the Job/Step/Adv/Output to file option, and "tail"
the file?
TIA
J.
In this case, the client application is SQL Server Agent, more specific, the sub-component in Agent
that executes your TSQL job steps. And Agent isn't written to output this information "as it goes".
It might update the output file as information comes in (I haven't tested this), so I think that
this is probably your best bet. Another option is of course to schedule an EXE file that you wrote
and you have in your EXE file code to output the information to where ever you want it to go.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"J Hunter" <ms-nntp-nospam@.jshunter.co.uk> wrote in message
news:eL976GjHFHA.1860@.TK2MSFTNGP15.phx.gbl...
> Hi Folks,
> I'm trying to find a way to get access to the STATS output from the BACKUP
> command during automated backups.
> When running the BACKUP command in QA it shows the output, line by line, as
> the backup progresses. Is there any way I can get this information when the
> BACKUP statement is run from a job? I thought the console tool might have
> been the answer, but it doesn't show any progress messages.
> Is the only option to use the Job/Step/Adv/Output to file option, and "tail"
> the file?
> TIA
> J.
>
>
|||Thanks Tibor
With regard to your comments on creating my own EXE, how would I go about
getting access to the messages - given that they are not returned as part of
a result set?
Cheers
J.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OU%23Lr5lHFHA.4060@.TK2MSFTNGP14.phx.gbl...
> In this case, the client application is SQL Server Agent, more specific,
the sub-component in Agent
> that executes your TSQL job steps. And Agent isn't written to output this
information "as it goes".
> It might update the output file as information comes in (I haven't tested
this), so I think that
> this is probably your best bet. Another option is of course to schedule an
EXE file that you wrote
> and you have in your EXE file code to output the information to where ever
you want it to go.[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "J Hunter" <ms-nntp-nospam@.jshunter.co.uk> wrote in message
> news:eL976GjHFHA.1860@.TK2MSFTNGP15.phx.gbl...
BACKUP[vbcol=seagreen]
as[vbcol=seagreen]
the[vbcol=seagreen]
have[vbcol=seagreen]
"tail"
>
|||First I believe that you have to program asynchronously. Otherwise the command will be blocked until
it has finished. These are returned as messages, technically same way as PRINT and errors. I'm no
API expert, so you might want to investigate this further and possibly asking in a newsgroup
dedicated to the API you are using (ADO, ADO.NET etc).
The bigger problem is how your EXE will output to the screen. Remember that agent is a service (in
"NT") and a service has no Window context...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"J Hunter" <ms-nntp-nospam@.jshunter.co.uk> wrote in message
news:ePdMhboHFHA.236@.TK2MSFTNGP14.phx.gbl...
> Thanks Tibor
> With regard to your comments on creating my own EXE, how would I go about
> getting access to the messages - given that they are not returned as part of
> a result set?
> Cheers
> J.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OU%23Lr5lHFHA.4060@.TK2MSFTNGP14.phx.gbl...
> the sub-component in Agent
> information "as it goes".
> this), so I think that
> EXE file that you wrote
> you want it to go.
> BACKUP
> as
> the
> have
> "tail"
>
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment