Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
How to Create Zip file from Stored Procedure in SQL SERVER 2008?
Suppose i have file in D:\Test
And i want to Zip that folder in any other location like c:\Test.zip
Please let me know is it possible or not if yes then how?
Posted

1 solution

You can create the zip file using SQL Stored proc. You need to invoke the shell and call the corresponding program or API to zip the file.
I am not sure what is your exact requirement, but invoking a shell from SQL Proc and calling another program is not a good practice.

If you still want to zip the file using stored proc go through the below links:

http://blog.akumars.esoftera.in/post/2012/05/17/Create-zip-file-in-stored-procedure-in-Sql-server.aspx[^]

http://blog.akumars.esoftera.in/post/2012/05/17/Create-zip-or-rar-file-in-stored-procedure-in-Sql-server.aspx[^]
 
Share this answer
 
Comments
Shubhranshu from Mumba 14-Feb-13 2:09am    
Acctually i have already tried both mentioned example, but first link
give me that error "Code Execution Exception: EXCEPTION_ACCESS_VIOLATION"

And secod Example giving another error..
Kiran Susarla 14-Feb-13 2:15am    
Where exactly are you getting this error?
Shubhranshu from Mumba 14-Feb-13 3:30am    
When i am executing Procedure..
Kiran Susarla 14-Feb-13 6:47am    
I understand that when you execute the stored procedure you are getting the error. Have you tried debugging by inserting some print statements and check which line is throwing the error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900