January 2, 2006 at 10:18 am
When running the statement BACKUP DATABASE MyNwind TO MyNwind_2
is there any other syntaxs available that will give the output (percentage complete) to this task?
Appreciate replies.
January 2, 2006 at 5:33 pm
There is an option STATS that defaults to 10%.
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
January 2, 2006 at 8:58 pm
Hi,
Peter, I can help you with the syntax.'Test' is my database and use the STATS option while backing up
backup database test
to disk = N'd:\test\testbackup.bak'
with NAME= N'testbackup.bak',stats=10
The Result would be something like this:
99 percent backed up.
Processed 80 pages for database 'test', file 'test' on file 3.
100 percent backed up.
Processed 1 pages for database 'test', file 'test_log' on file 3.
BACKUP DATABASE successfully processed 81 pages in 0.242 seconds (2.712 MB/sec).
My database is too small to be counted.Hope this helps you.
January 2, 2006 at 9:33 pm
Great thnxs for your help! Its worked out perfectly
January 3, 2006 at 8:05 am
Try DBCC OUTPUTBUFFER (spid) . Where spid is the backup process. This is as or more accurate than the stats option.
January 3, 2006 at 8:14 am
Do you know the command to cause the results to show up in Query Analyzer as they happen instead of when the batch is completed?
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
January 3, 2006 at 10:29 am
I'm not positive, but I believe that in QA if you go into Tools-Options-Results and select 'Scroll results as received', the output will get displayed as it's returned. (It may only work with text output.)
January 3, 2006 at 10:34 am
Thanks! I knew it would be somthing obvious that I overlooked!
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
April 13, 2015 at 11:54 pm
I see the DBCC inputbuffer (spid) will give what are the current statement is running...but don't about DBCC outputbuffer(spid).
Can you pls describe about DBCC OUTPUTBUFFER and give some more clarification on different between INPUTBUFFER and OUTPUTBIFFER....
Thanks in advance 🙂
April 13, 2015 at 11:55 pm
peterus (1/3/2006)
Try DBCC OUTPUTBUFFER (spid) . Where spid is the backup process. This is as or more accurate than the stats option.
I see the DBCC inputbuffer (spid) will give what are the current statement is running...but don't about DBCC outputbuffer(spid).
Can you pls describe about DBCC OUTPUTBUFFER and give some more clarification on different between INPUTBUFFER and OUTPUTBIFFER....
Thanks in advance 🙂
April 14, 2015 at 12:15 am
mohan.bndr (4/13/2015)
peterus (1/3/2006)
Try DBCC OUTPUTBUFFER (spid) . Where spid is the backup process. This is as or more accurate than the stats option.
I see the DBCC inputbuffer (spid) will give what are the current statement is running...but don't about DBCC outputbuffer(spid).
Can you pls describe about DBCC OUTPUTBUFFER and give some more clarification on different between INPUTBUFFER and OUTPUTBIFFER....
Thanks in advance 🙂
please check the below link
http://www.sqlservercentral.com/Forums/Topic1156526-1292-1.aspx
April 14, 2015 at 11:21 am
Wow, a 9 year old post reply!
I use something like this now:
Here's the link to outputbuffer: https://msdn.microsoft.com/en-us/library/ms189821.aspx
July 23, 2015 at 10:24 am
EDIT : I have just figured out the post is very old and is for SQL 7 , 2000 🙂
Hi Peter,
Below the query I use for this purpose:
SELECT percent_complete, start_time,
DATEADD(MILLISECOND, (estimated_completion_time + total_elapsed_time), start_time) AS estimate_end_time,
SUBSTRING(T.text, 1 + CHARINDEX('[', T.text), CHARINDEX(']', T.text) - 1 - CHARINDEX('[', T.text)) AS DatabaseName,
T.text
FROM sys.dm_exec_requests R
CROSS APPLY sys.dm_exec_sql_text(R.sql_handle) T
WHERE session_id > 50
AND command LIKE '%back%' OR command LIKE '%rest%';
Hope it will help,
Max.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply