SQL SERVER BACKUPS

Hi

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
jpmoreauAsked:
Who is Participating?
 
Vikas GargConnect With a Mentor Business Intelligence DeveloperCommented:
HI,

This can be achieved through the Following T-SQL

BACKUP DATABASE [dbname]
TO DISK = '\\RemoteSystem\Shared\dbname.Bak';
GO

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.


Thanks,
0
 
plusone3055Commented:
EXEC XP_cmdshell<Your mapped drive letter here><UNC Path to shared drive>

that should let you back up to a shared drive :)
0
 
jpmoreauAuthor Commented:
ok

Is it permanent?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
plusone3055Commented:
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 :)
0
 
jpmoreauAuthor Commented:
Last question

Do I run this in SQLTRANSAT?
0
 
plusone3055Commented:
No just in a query window or make a stored procedure
0
All Courses

From novice to tech pro — start learning today.