Home All Groups Group Topic Archive Search About

Stats in backup / restore

Author
3 Feb 2006 6:59 PM
quilkin
Where do I find the STATS output from Backup or restore operations when these
are called programmatically? SQL books says "Displays a message each time
another percentage completes and is used to gauge progress." - but where can
I find that message, so I can use it to update a progress bar? Is a file
written somewhere? (I am using VS 2003, c#).

Author
3 Feb 2006 8:41 PM
Leila
You may use backup object of DMO. It has a event for the progress. You can
also display a progress bar to user.



Show quote
"quilkin" <quil***@discussions.microsoft.com> wrote in message
news:8391D2BF-489C-4060-B303-6E2D23AB138C@microsoft.com...
> Where do I find the STATS output from Backup or restore operations when
> these
> are called programmatically? SQL books says "Displays a message each time
> another percentage completes and is used to gauge progress." - but where
> can
> I find that message, so I can use it to update a progress bar? Is a file
> written somewhere? (I am using VS 2003, c#).
>
Author
4 Feb 2006 6:12 PM
quilkin
Hi Leila

Many thanks for the quick reply.
SQL-DMO appears to be designed for C/C++ and VB: no mention of it in .NET. I
was hoping I could achieve my requirement without learning a whole new
interface!

Thanks again anyway.

Show quote
"Leila" wrote:

> You may use backup object of DMO. It has a event for the progress. You can
> also display a progress bar to user.
>
>
>
> "quilkin" <quil***@discussions.microsoft.com> wrote in message
> news:8391D2BF-489C-4060-B303-6E2D23AB138C@microsoft.com...
> > Where do I find the STATS output from Backup or restore operations when
> > these
> > are called programmatically? SQL books says "Displays a message each time
> > another percentage completes and is used to gauge progress." - but where
> > can
> > I find that message, so I can use it to update a progress bar? Is a file
> > written somewhere? (I am using VS 2003, c#).
> >
>
>
>
Author
4 Feb 2006 3:19 PM
quilkin
A bit more searching has found ' SqlInfoMessageEventHandler' for the
SQlConnection I'm using from C#. But the event only fires when the backup is
complete (the final event message contains a whole list of '%complete' lines)
- it doesn't fire for each individual percentage completion. So this doesn't
acheive my objective.
Any other ideas greatly appreciated!

Show quote
"quilkin" wrote:

> Where do I find the STATS output from Backup or restore operations when these
> are called programmatically? SQL books says "Displays a message each time
> another percentage completes and is used to gauge progress." - but where can
> I find that message, so I can use it to update a progress bar? Is a file
> written somewhere? (I am using VS 2003, c#).
>
Author
6 Feb 2006 9:03 AM
Ian Stocks
"quilkin" <quil***@discussions.microsoft.com> wrote in message
news:6C3A612B-81D8-4BAC-A9BB-1872B782B41B@microsoft.com...
>A bit more searching has found ' SqlInfoMessageEventHandler' for the
> SQlConnection I'm using from C#. But the event only fires when the backup
> is
> complete (the final event message contains a whole list of '%complete'
> lines)
> - it doesn't fire for each individual percentage completion. So this
> doesn't
> acheive my objective.
> Any other ideas greatly appreciated!

Have you specified 'with stats = x%' on the backup command. Without that you
will only get a message when the backup is complete.

Ian.
Author
6 Feb 2006 11:56 PM
quilkin
Hi Ian

Yes, I have had "....WITH INIT,STATS=10" for  a while (there is a syntax
error if I put "10%") - but still the message event only fires at the end of
the backup.

Show quote
"Ian Stocks" wrote:

> "quilkin" <quil***@discussions.microsoft.com> wrote in message
> news:6C3A612B-81D8-4BAC-A9BB-1872B782B41B@microsoft.com...
> >A bit more searching has found ' SqlInfoMessageEventHandler' for the
> > SQlConnection I'm using from C#. But the event only fires when the backup
> > is
> > complete (the final event message contains a whole list of '%complete'
> > lines)
> > - it doesn't fire for each individual percentage completion. So this
> > doesn't
> > acheive my objective.
> > Any other ideas greatly appreciated!
>
> Have you specified 'with stats = x%' on the backup command. Without that you
> will only get a message when the backup is complete.
>
> Ian.
>
>
>

AddThis Social Bookmark Button