M
M
Mr. Abdu Jan2014-01-27 08:46:32
SQL
Mr. Abdu Jan, 2014-01-27 08:46:32

How to set up a daily backup of a SQL Server 2005 database?

Hello,
I have a database on SQL SERVER 2005.
The task is to make a backup of the database every day and store backup files every 7 days.
For example,
database_2014-23-01_00:00:00.bak
database_2014-24-01_00:00:00.bak
database_2014-25-01_00:00:00.bak
database_2014-26-01_00:00:00.bak
database_2014-27 -01_00:00:00.bak
database_2014-28-01_00:00:00.bak
database_2014-29-01_00:00:00.bak
Used script:

BACKUP DATABASE [ExchangeOffice] TO DISK = N'D:\Microsoft SQL Server\Backup\ExchangeOffice.bak'WITH NOFORMAT, INIT, NAME = N'ExchangeOffice-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

But it does not suit me, because the backup file is stored only for one day, and I need it to be stored for a certain day (for example, 7 days).
Any ideas?
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Usov, 2014-01-27
@rahs

Rotate with an external script once a day

N
Nikolai Turnaviotov, 2014-02-01
@foxmuldercp

um, but you can make a wrapper in a powershell script, for example
, I have a sequel database backed up by a regular win server backup , and
here is the script code
pastebin.com/9BQj4bXm

A
asd24, 2014-02-27
@asd24

Alternatively, Maintenance Plan

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question