Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

Starting Member

35 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.


Starting Member

35 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  
 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.02 seconds. Powered By: Snitz Forums 2000