Solved

Extract Query result from SQL server in SSIS into CSV flat file , Compress CSV and send the CSV File by email

Posted on 2010-11-12
3
1,148 Views
Last Modified: 2013-11-18
Hello,

I have a query to extract records of about 7 million rows in SSIS from SQL server. I then need to dump the data as CSV , and then compress the CSV file to be able to mails it using my smtp server with the send mail task.

The tricky part is :   How to compress the CVS fils in SSIS possibly using a Script component.

Your help is appreciated .Other solutions will be accepted apart from my requested solution.

Thanks
0
Comment
Question by:marvo2010
3 Comments
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34119964
You could use a operating system comand an do it that, i have seen this done before which worked fine. You just need to be able to execute a zip program.
0
 
LVL 19

Accepted Solution

by:
Bhavesh Shah earned 250 total points
ID: 34120310
0
 
LVL 6

Assisted Solution

by:subhashpunia
subhashpunia earned 250 total points
ID: 34120382
You can perform these tasks as below:

1. Export to CSV : can be performed by SSIS
2. ZIP : You can use shareware tools like 7-zip command line and use the command like 7za.exe ....
3. Mail the file by using the SQL server's Database Mail utility. To know more about how to configure database pls check this post:

http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now