Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-server-2005 SQL , +
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 13-Feb-13 20:56pm

1 solution

Rate this: bad
good
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:
 
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[^]
  Permalink  
Comments
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 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2014
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