My question is straight forward, how can I program SQL SMO to take local backup, by connecting to a remote server. I want to save the bak file to a local machine which is connecting to the remote server. Also I want users with only certain privilege to be able to save backups locally.
相关问题
- sql execution latency when assign to a variable
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
EDIT: re-reading your question and marc_s answer my answer will only work if by remote server you're talking about a server on your network somewhere. If you're talking about a hosted SQL Server on another domain somewhere marc_s is right and my answer is of no use. I'll leave it here anyway in case you are talking about a server in your domain. Edit Ends
After setting a share on my local C:\tmp directory running this bit of Powershell does the backup.
I know you didn't mention Powershell but since I saw the .net tag I thought it might still be some help. Shouldn't be too much effort to rewrite to your .net flavor of choice.
You cannot - period. Backups of SQL Server can only be saved to a local disk - local to the SQL Server itself.
You cannot with any tricks or tools backup a remote SQL Server to your local harddisk. Just can't do it.