delete backup files through tsql code

How do you use a OS command to delete a backup created on disk. through tsql code?

thanks
LVL 6
anushahannaAsked:
Who is Participating?
 
Om PrakashCommented:
Check the link to do it using script:
http://www.mssqltips.com/tip.asp?tip=1324

From TSQL, use
XP_DELETE_FILE (2005) and SQLMaint (2000) to delete the older files
0
 
anushahannaAuthor Commented:
That did it. Thanksom_prakash_p.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:

use any of these options while creating the backups RETAINDAYS EXPIREDATE
0
 
anushahannaAuthor Commented:
Thanks Aneesh.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.