开发者

How to determine the result of a SQL Server DB Backup?

I am calling the following statement from withing a Stored Proc in SQL Se开发者_如何学JAVArver 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜