views:

11

answers:

1

I am calling the following statement from withing a Stored Proc in SQL Server 2005.

Backup Database @dbname to disk = @dest 

I need to be able to store the result of the 'Backup Database' in a variable so if something goes wrong I can kick off an alert to notify someone of the failure. How can I get that value?

A: 

You can execute the Backup Database command within a TRY block I believe. Simply add some code to email the error message in the catch block of the statement.

JamWheel