Click here to Skip to main content
11,805,035 members (58,586 online)
Rate this: bad
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 at 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 at 14-Feb-13 2:15am
Where exactly are you getting this error?
Shubhranshu from Mumba at 14-Feb-13 3:30am
When i am executing Procedure..
Kiran Susarla at 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
0 OriginalGriff 315
1 CPallini 210
2 Richard Deeming 200
3 Sergey Alexandrovich Kryukov 168
4 CHill60 150
0 OriginalGriff 3,255
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2015
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