ZipExtract_To_Table

Returns the extracted content a Zip Archive as a table

  • Stored Procedure
  • SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017

Syntax:

EXEC SQLHTTP.net.ZipExtract_To_Table @ZipFilePath, @IncludeFilesContent

Arguments:

Name Type Description
@ZipFilePath varchar(4000) Full path to an existing zip file
@IncludeFilesContent bit An indicator as to whether the content of archived files will be included in a column named “Base64Content”

Table Returned:

Column name Data type Description
RowID int Row Index
Path nvarchar(4000) Relative path
FileName nvarchar(4000) File name, empty string for directories
IsDirectory bit 1 = true, 0 = false
Attributes nvarchar(4000) Directory, Archive
CompressedSize bigint Size in bytes
UncompressedSize bigint Size in bytes
Comment nvarchar(4000) File comment, if any
CreationTime datetime
ModifiedTime datetime
AccessedTime datetime
CompressionLevel nvarchar(4000)
CompressionMethod nvarchar(4000)
CompressionRatio float Percentage
CRC int
Encryption nvarchar(4000)
UsesEncryption bit 1 = true, 0 = false
Base64Content nvarchar(MAX) If @IncludeFilesContent = 1 this field will contain the content of file in Base64 encoding

Remarks:

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.

Sample Usage:

See Also: