Remote Backup of MSSQL Server

Source: Internet
Author: User
Tags mssql server
-- Backup environment: Back up the database (TEST) of the database server (192.168.1.8) to C $ under (192.168.1.145) -- first, create a exec ing with the client exec master .. xp_cmdshell 'net use Z: // 192.168.1.145/C $ "password"/User: 192.168.1.145/Administrator '/* -- Note: Z: The drive letter corresponding to the local machine mapped to the network path, the corresponding // 192.168.1.145/C $ to be mapped to the following Backup is the network path 192.168.1.145/administrator192.168.1.145 which is the name of a remote computer, administrator is the password of the administrator user specified in the logon username and password -- */-- Second, backup the database test to disk = 'z:/test. bak' -- last. after the backup is complete, delete the exec ing exec master .. xp_mongoshell 'net use Z:/delete' put the above job in sqlserver to achieve automatic backup effect. Further, You can automatically generate the backup name exec master .. xp_mongoshell 'net use Z: // 10.1.1.197/d $/dbback "123456"/User: 10.1.1.197/Administrator 'descare @ a char (80) Select @ A = 'z: /'+ Replace (replace (convert (varchar (19), getdate (), 120 ),'','-'),':','-') + '-service_korea.bak' backup database pubs to disk = @ A exec master .. xp_mongoshell 'net use Z:/delete'

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.