简体   繁体   中英

How to backup linked servers with SQL Server?

I want to backup/restore my data which is distributed in some linked servers, which are connected or linked in a central server. How can I do this?

I'm using SQL Server 2012 in all my nodes.

you can use the remote machine to run sp_executesql command within the dynamic SQL.

exec server.master.dbo.sp_executesql 'BACKUP DATABASE DBNAME1 to disk='\\Server\Share\backupfilename.bak''

Or you can do this

exec server.master.dbo.sp_executesql 'BACKUP DATABASE [DBNAME1] to disk='\\Server\Share\backupfilename.bak''

Both line are almost identical , except the square bracket [] on the second syntax.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM