Messages back from SqlServer using Ado.net?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a WinForms application in which I am wrapping the backing up of a sql
database. In order to back up the database I am using the BACKUP DATABASE
t-sql and the STATS=5 in order to get the progress back from sql server.

Here is the exact script:
BACKUP DATABASE test_dvpt
TO test_Backup
WITH INIT,
STATS=5

Does anyone know how I can get the messages like "5 percent backed up" ...
"10 percent backed up" to my win forms application in order to update a
progress bar?
 
Only if you use an async call to execute the command and then you would have
to guess as to the time. The utility TSQL commands don't return events or
messages that you can trap--at least none that I know of. Perhaps you might
have better luck with SQL DMO or SMO (in .NET). I would also ping the SQL
Server list.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
www.sqlreportingservices.net
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top