Posted on 2014-04-24
Last Modified: 2014-05-08

I use SQL SERVER 2008R2 and I Wonder if there is a way to perform backups of my databases on a map drive or a foreign server.

For now I'm able to perform backups only on local drives.

Thank you
Question by:jpmoreau
  • 3
  • 2
LVL 22

Expert Comment

ID: 40021296
EXEC XP_cmdshell<Your mapped drive letter here><UNC Path to shared drive>

that should let you back up to a shared drive :)

Author Comment

ID: 40021336

Is it permanent?
LVL 22

Expert Comment

ID: 40021380
it should be
I cannot say with absolute 100% confidence

you would wnat to do that for each lettered drive you have

to ensure it being permentant you can alway make that a stored procedure and set it to run at startup or as a job to run at 12:01am every day :)
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.


Author Comment

ID: 40021396
Last question

Do I run this in SQLTRANSAT?
LVL 22

Expert Comment

ID: 40021576
No just in a query window or make a stored procedure
LVL 15

Accepted Solution

Vikas Garg earned 500 total points
ID: 40029391

This can be achieved through the Following T-SQL

TO DISK = '\\RemoteSystem\Shared\dbname.Bak';

However to perform it successfully few points need to be taken care.
The RemoteSystem and drive where you want the back up to be stored must be accessible by the Service account on which the SQL Service is running.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TOOLS - convert T-SQL TO PL/SQL 3 54
SQL Server 2012 r2 - Varible Table 3 32
average of calculation (TSQL) 4 26
SQL - format decimal in a string 5 39
I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question