Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

advanced backup

Status
Not open for further replies.

ProBani

Programmer
Mar 21, 2005
48
YU
Hi everybody,

how is possible to backup database on different files by date, I mean to be created everyday on scheduled basis bak files by date - bckpmydb08052005.bak;bckpmydb08062005.bak ... I mean not to be appended or overwrited, but each file everyday (everyday toi be created ne file).

Thanks,
ProBani.
 
Enterprise Manager --> Management --> Right Click Database Maintenance Plan

New Maintenance Plan.

If you follow the wizard, you should get the desired results.



Q
 
You can also do this by hand by dynamically generating the backup file name.
Code:
declare @filename varchar(100)
set @filename = 'c:\mydatabase_' + convert(varchar(4), year(getdate())) + convert(varchar(2), month(getdate())) + convert(varchar(2), day(getdate())) + '.bak'
backup database MyDatabase to disk=@filename

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(Not quite so old any more.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top