Removing any output from BACKUP operation on SQL Server

%3CLINGO-SUB%20id%3D%22lingo-sub-2271384%22%20slang%3D%22en-US%22%3ERemoving%20any%20output%20from%20BACKUP%20operation%20on%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2271384%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EApparently%20there%20is%20no%20way%20to%20remove%20the%20output%20produced%20by%20the%20BACKUP%20command.%3C%2FP%3E%3CP%3EYou%20can%20use%20the%20trace%20flag%203226%20to%20remove%20the%20writing%20to%20the%20SQL%20Server's%20log%20file%2C%20and%20use%20the%20option%3C%2FP%3E%3CP%3E%3CSPAN%3EWITH%3C%2FSPAN%3E%20%3CSPAN%3ESTATS%3C%2FSPAN%3E%20%3CSPAN%3E%3D%3C%2FSPAN%3E%20100%20to%20reduce%20the%20number%20of%20completion%20messages%2C%26nbsp%3Bbut%20you%20will%20still%20have%20a%204%20lines%20message%20%3A%3C%2FP%3E%3CP%3E%3CEM%3E100%20percent%20processed.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EProcessed%20680%20pages%20for%20database%20'myDB'%2C%20file%20'myDB'%20on%20file%201.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EProcessed%201%20pages%20for%20database%20'myDB'%2C%20file%20'myDB_log'%20on%20file%201.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EBACKUP%20DATABASE%20successfully%20processed%20681%20pages%20in%201.272%20seconds%20(4.177%20MB%2Fsec).%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20really%20a%20big%20problem%20when%20you%20are%20calling%20BACKUP%20command%20from%20a%20service%20broker%20queue.%20Indeed%2C%20in%20this%20case%2C%20you%20will%20find%20in%20the%20SQL%20Server's%20log%20file%2C%20these%204%20lines%20(due%20to%20the%20fact%20that%20a%20service%20broker%20queue%20log%20everything%20wrote%20to%20the%20console%20output)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20someone%20can%20help%20me%20on%20that%2C%20it%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3CP%3EOr%20if%20it's%20not%20possible%20to%20suppress%20these%20rows%2C%20is%20there%20a%20way%20to%20ask%20for%20a%20new%20option%20for%20the%20BACKUP%20command%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello,

Apparently there is no way to remove the output produced by the BACKUP command.

You can use the trace flag 3226 to remove the writing to the SQL Server's log file, and use the option

WITH STATS = 100 to reduce the number of completion messages, but you will still have a 4 lines message :

100 percent processed.

Processed 680 pages for database 'myDB', file 'myDB' on file 1.

Processed 1 pages for database 'myDB', file 'myDB_log' on file 1.

BACKUP DATABASE successfully processed 681 pages in 1.272 seconds (4.177 MB/sec).

 

It's really a big problem when you are calling BACKUP command from a service broker queue. Indeed, in this case, you will find in the SQL Server's log file, these 4 lines (due to the fact that a service broker queue log everything wrote to the console output)

 

If someone can help me on that, it would be greatly appreciated.

Or if it's not possible to suppress these rows, is there a way to ask for a new option for the BACKUP command ?

 

Thanks in advance!

 

0 Replies