How to set the database backup path as a network path in SQL Server 2005

Source: Internet
Author: User
Tags copy net backup
server| Backup | data | database | network

How to set the database backup path as a network path in SQL Server 2005
such as: "\\BackupPC\dbback\"

SQL Server 2000 is OK, how to 2005 is not good to do???
=================================
Now back up the database is really troublesome, have to back up to the local, and then cut to the network of another computer in the neighborhood, really depressed!!!!

=================================================================================

Backup to a different machine? This is 2000 of the practice.

Write a stored procedure, set up a scheduled job backup ~ ~ ~


--It's OK to map it in SQL.
EXEC master.. xp_cmdshell ' net use z: \\yizhi\D$ ' password '/user:yizhi\administrator '

/*--Description:
EXEC master.. xp_cmdshell ' net use z: \\xz\c$ ' password '/user:xz\administrator '

Z: is the mapped network path corresponding to the local drive letter, corresponding to the following backup
\\xz\c$ is the network path to map

Xz\administrator
XZ is the remote computer name,
The administrator is the user name of the login
Password for the administrator user specified by the password surface
--*/

--backup; with init overwrite |noinit add
Backup Database library name to disk= ' E:\H_BACKUP.bak ' with init

--copy
EXEC master.. xp_cmdshell ' copy E:\H_BACKUP.bak z: '

--Delete (this sentence can be removed)
--exec Master. xp_cmdshell ' del E:\H_BACKUP.bak '

--Delete mappings after completion
EXEC master.. xp_cmdshell ' net use Z:/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.