is it possible to call 7-zip from a SQL script? basically i am extracting tables to csv and then packaging them into 7z files. I have installed 7-zip on the machine where SQL Server is installed and added it to the path, but this is not enough it seems.
I get the following error when i try to run the script with xp_cmdshell
'7z' is not recognized as an internal or external command,
operable program or batch file.
this is the code, i have already declared the variables
declare @archiveCommand nvarchar(max)
declare @filename nvarchar(max)
set @archiveCommand = '7z a '+@filename+'.7z '+@filename+' '
print @archiveCommand
EXEC master..xp_cmdshell @archiveCommand