ZipExtract_To_Folder
Extracts a Zip Archive to a new or existing folder
- Stored Procedure
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
EXEC SQLHTTP.net.ZipExtract_To_Folder @ZipFilePath, @ZipExtractFolderPath, [@SelectedEntryFullPath], [@Override]
Name | Type | Description |
---|---|---|
@ZipFilePath | varchar(400) | Required. Full path to an existing zip file |
@ZipExtractFolderPath | varchar(4000) | Required. Full path to a new or existing folder. If the folder does not exist, it will be created |
@SelectedEntryFullPath | varchar(4000) | Optional. A path within the zip archive of a file or folder to be extracted. Leave blank to extract all files and folders |
@Override | bit | Optional. An indicator as to whether existing files and folders in the ZipExtractFolderPath will be overridden. Default: 1 (True) |
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.
Extracts the entire content of a zip archive:
1 2 3 4 5 |
EXEC SQLHTTP.net.ZipExtract_To_Folder @ZipFilePath = 'C:\ThisFolderExists\ZipFile.zip', @ZipExtractFolderPath = 'C:\NewOrExistingFolder' |
1 2 3 |
Commands completed successfully. |
Extracts a selected folder in a zip archive:
1 2 3 4 5 6 |
EXEC SQLHTTP.net.ZipExtract_To_Folder @ZipFilePath = 'C:\NewOrExistingZipFile.zip', @ZipExtractFolderPath = 'C:\NewOrExistingFolder', @SelectedEntryFullPath = 'NestedSubfolder/' |
1 2 3 |
Commands 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