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)

Large auto-job-creation script for adding backups

By Oblio Leitch,

This script creates a stored proc that was intended to run from a trigger on the master..sysdatabases for each database creation. Alas. It will create three jobs for each database you apply it to. First, it'll create a job to run a full backup each Sun, at 5am (see below). Those backups will be retained for four weeks before being replaced. Next, it'll schedule a differential every night Mon-Wed, then a second for Thu-Sat. Finally, there's a trans log backup every three hours; each of which is not overwritten (eight files rotated).

You can edit the time that it's run by setting @timeOfDay, and you'll need to adjust @backupDevice to match your system. Also, there are four items you'll need to run once on your system before creation of the stored proc. The function is intended to be added to the msdb database; be sure to add permissions for 'public'.

This is my first 'professional' submission; I hope it's useful, and I appreciate any feedback/improvements.

Total article views: 366 | Views in the last 30 days: 4
 
Related Articles
FORUM

hoe to stop creating a daily database backup file

stop creating a daily database backup file

FORUM

Failing backup can't create backup

single database backup can't create file

FORUM

backup database

backup database

FORUM

Database Backup

Database Backup

FORUM

database backup

database backup

Tags
 
Contribute

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
Editor, SQLServerCentral.com

Already a member? Jump in:

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