﻿<?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 database / 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 07:16:47 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: backup database</title><link>http://www.sqlservercentral.com/Forums/Topic810515-146-1.aspx</link><description>[quote][b]Nero-1119276 (10/29/2009)[/b][hr]If i write this codebackup database to disk='Path'Now what should i use to include date in backup name likewisetestbackup01-01-2009.bck[/quote]You’ll have to use the date and time as a part the file’s name so the names will be unique and you’ll know when the backup was taken.  One option to do it is to write the backup statement as dynamic SQL and then use a combination of string manipulating and getdate() functions in order to get the file’s name.  Another option that is not widely known is to use the Agent’s tokens.  If you’ll use this option, you won’t have to use dynamic SQL and the agent will convert the tokens with the real value.  You can read about the SQL Agent tokens here – [url] http://www.sqldev.net/sqlagent/SQLAgentStepTokens.htm[/url]. Personally I’d use the maintenance wizard for that instead of writing it on my own.  Any reason that you are not using it?Adi</description><pubDate>Thu, 29 Oct 2009 00:31:38 GMT</pubDate><dc:creator>Adi Cohn-120898</dc:creator></item><item><title>RE: backup database</title><link>http://www.sqlservercentral.com/Forums/Topic810515-146-1.aspx</link><description>If i write this codebackup database to disk='Path'Now what should i use to include date in backup name likewisetestbackup01-01-2009.bck</description><pubDate>Thu, 29 Oct 2009 00:20:34 GMT</pubDate><dc:creator>Nero-1119276</dc:creator></item><item><title>RE: backup database</title><link>http://www.sqlservercentral.com/Forums/Topic810515-146-1.aspx</link><description>The easiest way is to use the maintenance wizard.  It will create a different file for each backup and will delete old files according to the way that you configured the maintenance job.  If you don’t want to use the maintenance wizard, you can write your own code that does the same thing.Adi</description><pubDate>Thu, 29 Oct 2009 00:05:09 GMT</pubDate><dc:creator>Adi Cohn-120898</dc:creator></item><item><title>backup database</title><link>http://www.sqlservercentral.com/Forums/Topic810515-146-1.aspx</link><description>hi all,I have configured a job in EM.For full backup and differential backup.But i have only two option where i can append to media or overwrite existing backup.But as per policy i should maintain automated backup for at least a previous week.Current i take FULL backup in morning around 10 and differentail after 5 hours.Now how can i maintain week backup when i have only two option1.APPEND TO MEDIAoption2.Overwrite existing mediathanks,Neerav</description><pubDate>Wed, 28 Oct 2009 23:54:24 GMT</pubDate><dc:creator>Nero-1119276</dc:creator></item></channel></rss>