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 2000 Forums
 SQL Server Administration (2000)
 Replacing Maintenance plan

Author  Topic 

chris_wood99
Yak Posting Veteran

70 Posts

Posted - 2005-07-15 : 11:20:38
I'm trying to replace the maintenance plans with individual jobs as finding them a bit flakey, i can only see the retain for so many days option, but how do i syntax sql to remove files older than say 3 days if my backups are daily so the disk doesn't get full up

SQLServerDBA_Dan
Aged Yak Warrior

752 Posts

Posted - 2005-07-15 : 11:44:33
quote:
Originally posted by chris_wood99

I'm trying to replace the maintenance plans with individual jobs as finding them a bit flakey, i can only see the retain for so many days option, but how do i syntax sql to remove files older than say 3 days if my backups are daily so the disk doesn't get full up




BACKUP DATABASE { database_name | @database_name_var }
TO < backup_device > [ ,...n ]
[ WITH
[ BLOCKSIZE = { blocksize | @blocksize_variable } ]
[ [ , ] DESCRIPTION = { 'text' | @text_variable } ]
[ [ , ] DIFFERENTIAL ]
[ [ , ] EXPIREDATE = { date | @date_var }
| RETAINDAYS = { days | @days_var } ]
[ [ , ] PASSWORD = { password | @password_variable } ]
[ [ , ] FORMAT | NOFORMAT ]
[ [ , ] { INIT | NOINIT } ]
[ [ , ] MEDIADESCRIPTION = { 'text' | @text_variable } ]
[ [ , ] MEDIANAME = { media_name | @media_name_variable } ]
[ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]
[ [ , ] NAME = { backup_set_name | @backup_set_name_var } ]
[ [ , ] { NOSKIP | SKIP } ]
[ [ , ] { NOREWIND | REWIND } ]
[ [ , ] { NOUNLOAD | UNLOAD } ]
[ [ , ] RESTART ]
[ [ , ] STATS [ = percentage ] ]


Daniel
SQL Server DBA
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-07-15 : 13:17:28
Here you go:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx

Tara
Go to Top of Page
   

- Advertisement -