SSIS execution of stored procedure to output to send mail task.
Hello I am working on an SSIS task to simply do two things in Control flow: 1. Execute a stored procedure 2. Send the results in the BODY of an SMTP email. Let's give some background on the stored procedure. It has no parameters in or out. All it does is look at a sequence of events and provide a set of text back to an end user. It does this to give header's and such with many if, then, print statements. I read a good article here on this: http://www.julian-kuiters.id.au/article.php/ssis-execute-sql-task-output-parameters if you have output parameters but what if you don't? Would it be best practice to try and give my reporting sproc an output parameter? I have not worked with those much so I would need a little help on that as well. I do NOT wish to end up using Database Mail or the like so please do not provide that as an answer as this solution will not work. I know that this entire process will work fine if I use a data flow task and then take my results to flat file to then output that, but it did not work with the stored procedure. I think it is due to their not being a recognized column or output name. However if that is the case is output for SSIS limited to only XML or grid aligned values and not a text report? My other thought then would be if I could run the executable to stored file and then take that as the body of my message. Anyways, I figured someone else probably ran into something like this and had a far easier method than mine for remedying this. Any help is much appreciated. ThanksMedium to Advanced on some things, but always wanting to know more
December 20th, 2010 1:31pm

Hi, You only need configure SQL Execute Task to execute the SP and get the result by setting the Result Set option on main page and later assign result to variable(s) in Result Set Page. Check this post for more help http://www.simple-talk.com/sql/ssis/passing-variables-to-and-from-an-ssis-task/ and Technet documentation http://technet.microsoft.com/en-us/library/ms141003.aspx If your result is a single row, you can compose the body using ssis expression. If is a set then use a dataflow or script component to read all files and compose a complex message.Vctor M. Snchez Garca (ES) (BI) Hope this help. Please vote if you find this posting was helpful. if this is an answer to your question, please mark it. http://bifase.blogspot.com | http://twitter.com/atharky
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2010 1:51pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics