|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Stats in backup / restoreWhere 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#). 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#). > 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#). > > > > > 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#). > "quilkin" <quil***@discussions.microsoft.com> wrote in message Have you specified 'with stats = x%' on the backup command. Without that you 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! will only get a message when the backup is complete. Ian. 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. > > > |
|||||||||||||||||||||||