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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Differential Backup 1

Status
Not open for further replies.

Jimmy2128

Programmer
Feb 6, 2003
58
0
0
US
I have set a differential back p for one of our database in accouting, Database is backing up every hours but is overwriting the existing one. I would like to be able to set up in a way where is save during 22 hours until fullback is created at 9:00 pm

Example I want to save the files this way:

name_db_111520051200.bak
name_db_111520051300.bak
name_db_111520051400.bak

Thanks for all the assistance

Jimmy
 
You will have to play around with the date format a bit, but this should get you started:

Code:
declare @device varchar(100)
set @device = 'D:\pubsBkup_' + convert(varchar(10), getdate(), 121) + '.bak' 
backup database pubs to disk = @device with init
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top