SQL Server backs up the database of the remote server to a local folder

Source: Internet
Author: User

Exec sp_configure 'show advanced options', 1; reconfigure; Exec sp_configure 'xp _ Your shell', 1; reconfigure;

Enable 'xp _ external shell'

 

Note: to create a new user, the startup account of the MSSQLServer service must have the same name and password as the valid access to the shared directory, in this way, you can pass the verification (so you can use another valid user instead, only the user name and password must be the same and have sufficient permissions)
Step 1 share the folder E: \ AA with the name Test
NET Share test = E: \ AA
Step 2: Execute the SQL statement to create an image Z on the database server:
Exec master.. xp_mongoshell 'net use Z: \ hyserver \ test MMD/User: admin'
Step 3: perform backup
Backup database cs01 to disk = 'z: \ cs01_05-12-26.bak'
Step 4: Delete the image Z on the database server:
Exec master.. xp_mongoshell 'net use Z:/delete'
Step 5 cancel the Local Shared Folder Test
NET Share test/delete

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.