SQL Server Job backup

Source: Internet
Author: User

Steps for automatic backup in SQL Server 2005 database:
1. Open SQL Server Management Studio

2. Start the SQL Server proxy

3. Click job> create job.

4. Enter the job name in "regular"

5. Create step, type select T-SQL, enter the following statement in the following command

Declare @ strpath nvarchar (200)
Set @ strpath = convert (nvarchar (19), getdate (), 120)
Set @ strpath = Replace (@ strpath ,':','.')
Set @ strpath = 'd: \ Bak \ '+ 'databasename' + @ strpath +'. Bak'
Backup database [databasename] to disk = @ strpath with noinit, nounload, noskip, stats = 10, noformat

(Change D: \ Bak \ To your backup path, and change databasename to the name of the database you want to back up)

6. Add a plan and set the frequency and time.

OK.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.