Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sqlserver backupset name with date?

0 views
Skip to first unread message

andrewl

unread,
Jun 10, 2009, 4:57:37 PM6/10/09
to
Hi,

I am a newbie in sqlserver 2005. I would like to backup with new
backup name with date eg. backup200900601, backup20090602 etc. how am
I going to do it?
In real production large database practice, is the backup not append
to the backupset every day?

thanks

andrew

Ed Murphy

unread,
Jun 10, 2009, 6:51:17 PM6/10/09
to
andrewl wrote:

In SQL Server 2000, we routinely created a maintenance plan and let it
handle these details (include date as part of name, delete backups older
than X days old). Has this changed significantly in 2005?

Greg D. Moore (Strider)

unread,
Jun 11, 2009, 7:48:58 AM6/11/09
to
"andrewl" <landre...@gmail.com> wrote in message
news:aaabaf08-6111-49a7...@z7g2000vbh.googlegroups.com...

non-tested code, but something like this

declare @backupdate varchar(10);
declare @backupplace varchar(30);

select
@backupdate=datepart(yy,getdate())+datepart(mm,getdate())+datepart(dd,getdate())
--(may need to wrap it in cast statemants and the hour and minutes if you
want);

select @backupplace='x:\backups\FOO'+@backupdate;

backup database FOO to disk=@backupplace;


--
Greg Moore
Ask me about lily, an RPI based CMC.

samalex

unread,
Jun 17, 2009, 11:02:29 AM6/17/09
to
On Wed, 10 Jun 2009 17:51:17 -0500, Ed Murphy <emur...@socal.rr.com>
wrote:


Hi Ed,

First off long time no chat my friend :) It's Sam Alexander from FidoNet
388. I pinged you probably 5 or 6 years ago on another forum, but I don't
know if I ever checked back or saw your reply.

As for SQL Server backups on SQL 2005 and 2008, you can still setup
maintenance plans like you could in SQL 2000, but personally I've always
preferred writing my own code to do this since I always have some tweaks.
Most of our systems have nightly SSIS processes that run for various
tasks, and I just add my backup code to that so there's no timing issues.
Not to say it's the best way, but it works in our environment.

Take care, and good to see you're still around...

Sam Alex

0 new messages