Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
tech
Starting Member
32 Posts |
Posted - 2010-07-16 : 03:59:23
|
How do I perform this task and schedule it?I want to backup a remote database giving it credentials to use.I then want that backup to be transferred to the local computer - in other words, the computer that is initiating the backup request.is this possible?so - backup a remote DB and copy that DB locally.how so? |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2010-07-16 : 19:40:23
|
You could set up a SQL Job on the remote server which would perfrom the backup "locally" and then invoke the job from your local server using the sp_start_job stored procedure. Copying the file from the remote server to your local disk can be done outside of SQL or use the xp_cmdshell stored procedure to invoke an application that performs the file transfer.=======================================A couple of months in the laboratory can save a couple of hours in the library. -Frank H. Westheimer, chemistry professor (1912-2007) |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-07-17 : 05:58:32
|
1)If you were to do from within SQL Server the command would be something like : DECLARE @cmdstr VARCHAR(100)SET @cmdstr = 'COPY \\mynetworkpath\mybackup.bak K:\mybackup.bak@EXEC master..xp_cmdshell @cmdstrBe careful about enabling xp_cmdshell , for security reasons . Certainly in most environments I work on - this is not allowedTherefore , second optionIssue the COPY statement as a Task or part of a batch file , invoked by a user account with specific permissions on the OSJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-07-17 : 05:58:50
|
1)If you were to do from within SQL Server the command would be something like : DECLARE @cmdstr VARCHAR(100)SET @cmdstr = 'COPY \\mynetworkpath\mybackup.bak K:\mybackup.bak@EXEC master..xp_cmdshell @cmdstrBe careful about enabling xp_cmdshell , for security reasons . Certainly in most environments I work on - this is not allowedTherefore , second optionIssue the COPY statement as a Task or part of a batch file , invoked by a user account with specific permissions on the OSJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
sbglobal
Starting Member
4 Posts |
Posted - 2010-07-18 : 08:42:42
|
THANKSRaj singla |
|
|
|
|
|