FolderCopy
Copies a folder and its content from source to destination
- Stored Procedure
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
EXEC SQLHTTP.net.FolderCopy @SourceFolderPath, @DestinationFolderPath, @Recursive
Name | Type | Description |
---|---|---|
@SourceFolderPath | varchar(MAX) | Full path to the existing source folder |
@DestinationFilePath | varchar(MAX) | Full path to a non-existing destination folder |
@Recursive | bit | 1 = All sub-directories in @SourceFolderPath will be copied as well 0 = Existing sub-directories in @SourceFolderPath will NOT be copied. |
Accessing the file system will be performed in the context of the SQL Server instance process. You can set SQL Server to run using a specific network account, or a Local System Account.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
DECLARE @SourceFolderPath varchar(MAX) DECLARE @DestinationFolderPath varchar(MAX) DECLARE @Recursive bit SET @SourceFolderPath = 'C:\ThisFolderExists' SET @DestinationFolderPath = 'C:\ThisFolderWillSoonExist' --If you'd like sub-folders to be copied as well, set this value to 1. SET @Recursive = 0 EXEC SQLHTTP.net.FolderCopy @SourceFolderPath, @DestinationFolderPath, @Recursive |
1 2 3 |
Command(s) completed successfully. |
- CodePageEncodings
- FileCopy
- FileDecrypt
- FileDelete
- FileEncrypt
- FileMove
- FileRead
- Files_To_Table
- FileWrite
- FolderCopy
- FolderCreate
- FolderDelete
- FolderMove
- Folders_To_Table
- GlobalTable_To_File
- IsExistingFile
- IsExistingFolder
- TempPath
- ZipEntryAppend
- ZipEntryRemove
- ZipExtract_To_Folder
- ZipExtract_To_Table