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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Maintenance plan backup job

Author  Topic 

babloo
Starting Member

35 Posts

Posted - 2013-01-31 : 08:56:08
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

35 Posts

Posted - 2013-01-31 : 09:01:22
We can use select name from sysdatabases where dbid >4 and (status & 1024)= 0 <-- to select active dbs
Go to Top of Page
   

- Advertisement -