Skip to content

Instantly share code, notes, and snippets.

@evgenylavelin-xx
Created September 10, 2015 22:41
Show Gist options
  • Save evgenylavelin-xx/d0a8753a6c8e9eda6311 to your computer and use it in GitHub Desktop.
Save evgenylavelin-xx/d0a8753a6c8e9eda6311 to your computer and use it in GitHub Desktop.
DECLARE @SourceFile AS VARCHAR(500);
DECLARE @DestinationFile AS VARCHAR(500);
DECLARE @Cmd AS VARCHAR(500);
SET @SourceFile = '\\SourceFileName';
SET @DestinationFile = 'DestinationFileName';
SET @Cmd = 'COPY "' + @SourceFile + '" "' + @DestinationFile + '"';
EXEC master.dbo.xp_cmdshell @Cmd;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment