Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

Full, diff and tlog backups based on recovery mode

By Patty Dunbar,

    This a script which creates stored procedures that can be executed adhoc or set as sql agent jobs to check the recovery status and generate full, differential or transaction log backupf for each database if the database recovery status is set to full.  We have terabytes of data and set all production databases to full and all test and demo databases to simple. This helps to ensure all our production databases are backed up while avoiding unnecessary backups.
    The full and transaction log backup call the sqlmaint utility which simplifies deleting old backups by setting the -delbkup parameter. The differential backup includes an extra vbscript component to delete old backups as you cannot use the sqlmaint utility.
    Complete instructions are in the script so please read and follow carefully. Feel free to email me with any questions. When you get to the visual basic script portion, check the format as unlike SQL, all code must be on the same line or use the ampersand, followed by a space and then the underscore keystroke & _ after each line to continue to the next. My thanks to Mr. Knight as I used his book "SQL Server 2000 for Experienced DBAs" for reference when building components of this script.

Total article views: 896 | Views in the last 30 days: 1
Related Articles

Powershell Database Backup Script

Learn how to write a script for regular database backups using Powershell and SMO.


xmla script for automate ssas database backup

xmla script for automate ssas database backup


Script to Check the Database Backup duration

Script to Check the Database Backup duration of entire instances


Backup & Restoration Script

This script provides very useful information about database backup and restoration.


Script to Get the Backup History

Script to get the database backup history on SQL Server 2000/2005/2008


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones