Wednesday, 7 September 2011

How to copy a file from source to destination in SQL SERVER

Note : give below commands for enable  xp_cmdshell
(Stored Procudure). First of all we have Enable Inbuilt Stored Procedure.

EXEC master.dbo.sp_configure 'show advanced options', 1
EXEC master.dbo.sp_configure 'xp_cmdshell', 1

Exec master.dbo.xp_cmdshell 'Copy c:\source\*.sql c:\destination'

No comments:

Post a Comment