Click here to Skip to main content
13,042,630 members (74,658 online)
Rate this:
Please Sign up or sign in to 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:\
Please let me know is it possible or not if yes then how?
Posted 13-Feb-13 19:56pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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:[^][^]
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100