SQL Server backs up and compresses the backed-up files

Source: Internet
Author: User
Tags copy sql backup
server|sqlserver| Backup | compression
SQLSERVER2000 Backup

Example 1: (Backup)

1 Use Master
2 Declare @path = ' C:\aa\zy.bak '
3 Backup Database Zy to
4 disk= @path with Noinit

Description
1 Using System libraries
2 set the path and filename of the backup, note that it is quoted in single quotes.
3 databases to be backed up
4 Set up the backup drive, set the path to the drive, and then set the way to backup (override or overwrite)


Example 2: (compressed database file for backup)

Use master
exec xp_makecab ' C:\m.cab ', mszip,1, ' C:\aa\zy.bak '
exec xp_cmdshell ' copy c:\123.cab ', ' D:\123.cab '

Description
Name of ' C:\m.cab ' compressed backup
Mszip compression mode
The path of the ' C:\aa\zy.bak ' compressed file

Copy to another directory save


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.