Search This Blog

February 05, 2008

How can we supress successful messages in the EventLog

When running backup batch for each successfull backup a successfull message is logged in the EventLog and and log file.

We can supress this message by using DBCC trace flag at the start of the batch and end of the batch. If a DBA wants to backup around 100 databases and not interested in success messages this is more helpfull.

You can add your backup statements in between DBCC statements as shown below.


DBCC TRACEON (3226)
GO
BACKUP DATABASE AdventureWorks to disk = N'C:\AdventureWorks.BAK'
GO
BACKUP DATABASE AdventureWorksDW to disk = N'C:\AdventureWorksDW.BAK'
GO
DBCC TRACEOFF (3226)
GO

No comments: