EXPERT RESPONSE
Ideally you should use a database maintenance plan to handle this. The functionality is built in and handled by maintenance plans in both SQL Server 2000 and 2005. I just don't think Transact-SQL is the right tool for deleting old backup files. Before SQL Server 2005 I did use xp_cmdshell to execute OS commands. While these extended stored procedures still exist, they'll eventually go away because of what CLR integration provides.
Since you are running SQL Server 2005 you are able to create stored procedures in C# or VB.Net using Visual Studio 2005. That is exactly the route I would recommend. If you do, you will be able to execute the CLR procedure just like you would execute a Transact-SQL created stored procedure.
|