﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Question on sp_delete_backuphistory / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 10:47:44 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Question on sp_delete_backuphistory</title><link>http://www.sqlservercentral.com/Forums/Topic1408051-391-1.aspx</link><description>sp_delete_backuphistory deletes backup history from the MSDB backup history tables, it doesnt touch the filesystem!!You're referring to xp_delete_file to achieve this</description><pubDate>Thu, 17 Jan 2013 04:37:14 GMT</pubDate><dc:creator>Perry Whittle</dc:creator></item><item><title>RE: Question on sp_delete_backuphistory</title><link>http://www.sqlservercentral.com/Forums/Topic1408051-391-1.aspx</link><description>It will delete both. The parameter you are passing to sp_delete_backuphistory is telling it to delete ALL backup history OLDER than that date.</description><pubDate>Thu, 17 Jan 2013 01:20:10 GMT</pubDate><dc:creator>Ian Scarlett</dc:creator></item><item><title>Question on sp_delete_backuphistory</title><link>http://www.sqlservercentral.com/Forums/Topic1408051-391-1.aspx</link><description>If I have the following:[quote]SET @deleteday= dateadd(dd,-3,getdate())EXEC msdb.dbo.sp_delete_backuphistory @deleteday[/quote]In the folder, currently have backups for 01/13/2013, 01/14/2013, 01/15/2013So when the job runs, it'll delete 01/13/2013 backup from the folder. [u]Scenario[/u]If I change the day from -3 to -4 before the clean up job runs tonight, the job won't delete 01/13/2013 because it's looking for 01/12/2013. [quote]From @deleteday= dateadd(dd,-3,getdate())To @deleteday= dateadd(dd,-4,getdate())[/quote]And if I change the day tomorrow back from -4 to -3[quote]From @deleteday= dateadd(dd,-4,getdate())To @deleteday= dateadd(dd,-3,getdate())[/quote]it'll essentially be looking for 1/14/2013. My question is, will it delete 1/13/2013 [b]AND [/b]1/14/2013 backups? Or will it just delete 1/14/2013 backup and keep the 1/13/2013?Thanks!</description><pubDate>Wed, 16 Jan 2013 13:01:20 GMT</pubDate><dc:creator>MSSQL_NOOB</dc:creator></item></channel></rss>