﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Backup history / 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>Sun, 26 May 2013 03:36:48 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Backup history</title><link>http://www.sqlservercentral.com/Forums/Topic1032369-146-1.aspx</link><description>The above proc would also be run if you use the history cleanup task in a maintenance plan and select Backup and restore history</description><pubDate>Fri, 10 Dec 2010 03:47:09 GMT</pubDate><dc:creator>george sibbald</dc:creator></item><item><title>RE: Backup history</title><link>http://www.sqlservercentral.com/Forums/Topic1032369-146-1.aspx</link><description>we don't use that.Thanks for the tip.</description><pubDate>Fri, 10 Dec 2010 02:51:46 GMT</pubDate><dc:creator>river1</dc:creator></item><item><title>RE: Backup history</title><link>http://www.sqlservercentral.com/Forums/Topic1032369-146-1.aspx</link><description>There's a stored procedure sp_delete_backuphistory that you can use to purge old backup records from the msdb database.John</description><pubDate>Fri, 10 Dec 2010 02:46:48 GMT</pubDate><dc:creator>John Mitchell-245523</dc:creator></item><item><title>RE: Backup history</title><link>http://www.sqlservercentral.com/Forums/Topic1032369-146-1.aspx</link><description>What did you meant buy "cleanup operations" ?Thank you</description><pubDate>Fri, 10 Dec 2010 02:36:21 GMT</pubDate><dc:creator>river1</dc:creator></item><item><title>RE: Backup history</title><link>http://www.sqlservercentral.com/Forums/Topic1032369-146-1.aspx</link><description>select count(*) from msdb..backupset where database_name = 'yourdb' and type = 'D'However older backup history can be purged from this table by cleanup operations so unless you never run this purge and just allow the table to grow ad infinitum the info could be wrong. This table has an identity column backup_set_id you could use as an ever increasing number, but it would not reflect the actual number of backups for that database.</description><pubDate>Thu, 09 Dec 2010 17:25:16 GMT</pubDate><dc:creator>george sibbald</dc:creator></item><item><title>Backup history</title><link>http://www.sqlservercentral.com/Forums/Topic1032369-146-1.aspx</link><description>Hi,   I have created a job that makes backups.Code sample:declare @date as varchar(25)Declare @Nome as varchar(50)DECLARE Backups CURSOR FOR SELECT name from sys.databases where state =0order by nameset @date = convert(varchar,getdate(),120)set @date = replace(replace(@date,'-',''),':','')  OPEN backups FETCH NEXT FROM backups INTO @nomeWHILE @@FETCH_STATUS = 0BEGIN    			exec('backup database '+@nome+' to disk =''c:\database_backups\'+@nome+'\'+@nome+'_'+@date+'.BAK''')FETCH NEXT FROM backups INTO @nomeENDCLOSE backups DEALLOCATE backups The backups that are created by this job are name as:e.g:   SGI_20101209 111200.BAKNow i would like to add to the name of the backup, the number of backup.If the backup is the 3 backup of this database, i would like that the name become like this:SGI_3_20101209 111200.BAKWhere can i get the information of the number of backup already made to this database?</description><pubDate>Thu, 09 Dec 2010 04:52:20 GMT</pubDate><dc:creator>river1</dc:creator></item></channel></rss>