Cari Blog Ini

13 Juni 2012

Copy File Using Syntax SQL Command Shell - xp_cmdshell

----------------------------------------------------
-----code:start
----------------------------------------------------
Declare @CopyCommand as varchar(200)

select
@CopyCommand= 'Copy \\xxx.xxx.x.41\Share\DB_Test_120613_1319.dat '
    + ' \\xxx.xxx.x.44\Share\BackupDB\'
   
EXEC master..xp_cmdshell @CopyCommand, NO_OUTPUT
----------------------------------------------------
-----code:end
----------------------------------------------------

Results Messages:
Command(s) completed successfully.