Friday, March 30, 2012

How do I attach query results to send mail

I have several tasks that I don't want to use conditional failure on. I have a ON ERROR send mail task right now that works. I want to have that send mail task include query results from a separate query. How do I do that?

Peter Cwik

How about dropping the result of the query into a file usig the Flat File Destination and then attaching that file within Send Mail Task?

Just an idea...

-Jamie

|||SSIS is new to me...how do I do that?|||

What I just descibed is slightly advanced because it required the use of expressions. I don't want to try and cover those before you know the basics.

If I were you I would build the bit that populates a flat file first. You'll need a new data-flow. Drop an OLE DB Source Adapter into your data flow. Paste your query into the OLE DB Source Adapter.

Then, drop a Flat File Destination Adapter onto the data-flow. Drag a data path between your source adapter and your destination adapter. Open up the destination adapter editor and accept all the defaults - including building your flat file connection manager.

If none of that makes any sense then i recommend you work your way through the SSIS tutorial provided off the SQL Server install CD.

-Jamie

|||

That part makes sense.

Thanks!

No comments:

Post a Comment