Posted by Erland Sommarskog on 04/04/07 22:21
(m19peters@gmail.com) writes:
> We have a script that I had to rework a little bit for 2005 that does
> a full backup for every database on the server... For some reason on
> some nights the script does not backup all databases... Its like it
> skips over it for some reason... Output of the script below on the
> night in question was:
I don't see any apparent flaws, but two thoughts:
1) Make the cursor over sys.databases INSENSITIVE. The default cursor
type is dynamic, and it makes me nervous.
2) You should probably have some TRY-CATCH around the backup commands.
If backup fails with an error that aborts the batch you will not
backup the rest of the databases.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|