BULK IMPORT - zip file in T-SQL

I have data files that are stored on our company server with a .Z extension (UNIX compression utility used to replace them).

Can the SQL Server BULK IMPORT operation read these files in this format? Or should I unpack them before getting the data?

0


source to share


1 answer


BULK IMPORT would not be able to do this, but if you are using SQL2005 or higher you can use SSIS. The first step is to run the Exectute Process task and use the zip utility to unzip the file. The second step is to use the SSIS Bulk Insert task to enter data into SQL Server.



EDIT: Use compression from unixutils and not cygwin to unzip the files as it understands Windows proper filenames. This means you don't need to maintain / cygdrive paths as well as your own paths.

+3


source







All Articles