SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Maintenance plan backup job
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

babloo
Starting Member

USA
33 Posts

Posted - 01/31/2013 :  08:56:08  Show Profile  Reply with Quote
Hi, I am sorry if this is not the right place to post this question.

I currently have a maintenance plan that will first take the full backup of databases and then remove backup files. The problem is, the system first takes the backup and gets to a point where the drive gets full and fails the job, it does'nt get to a point to delete backup files.

I have an option to move Delete files first then take backup but that is not the right practice, that leaves me in a risk mode.

Is there a way you could help me with a script that will take full backup individually and remove old backup file for that database then take the next backup and delete back. So it can balance the storage?.. I only want active databases to be in this category.

Thanks
Babloo

babloo
Starting Member

USA
33 Posts

Posted - 01/31/2013 :  09:01:22  Show Profile  Reply with Quote
We can use select name from sysdatabases where dbid >4 and (status & 1024)= 0 <-- to select active dbs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000