Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 884
Steven Rojas Avatar asked Nov 30 '25 02:11

Steven Rojas


1 Answers

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''
like image 99
Leon Armstrong Avatar answered Dec 02 '25 17:12

Leon Armstrong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!