how to attach the data stored in a full result variable to the body of a message in send mail task in ssis

  • Hi Everyone,

    I would like to store the query results into a variable which is of object type as my result set operation is set to full result set in EXECUTE SQL TASK. I want to attach the data stored in a full result variable to the body of a message in send mail task.

    please suggest me some solution.

    Thanks in advance.

    Thanks.

    sai

  • saidwarak01 (1/11/2010)


    Hi Everyone,

    I would like to store the query results into a variable which is of object type as my result set operation is set to full result set in EXECUTE SQL TASK. I want to attach the data stored in a full result variable to the body of a message in send mail task.

    please suggest me some solution.

    Thanks in advance.

    Thanks.

    sai

    Sai,

    The result returned from Execute SQL Task can be either ADO Recordset, ADO.NET Dataset or something else depending on the used connection manager. You have to transform this result into text format (CSV or HTML) and then you can attach it to an email.

    If you can use third-party solutions, check the commercial CozyRoc Template Task. You can generate arbitrary types of text documents with it and we have also included a couple of samples how to generate text result from Recordset and Dataset.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Sai,

    You can also accomplish this by using T-SQL 'EXEC msdb.dbo.sp_send_dbmail'

    http://technet.microsoft.com/en-us/library/ms190307.aspx

    Hope this helps you.

    Thanks,

    Amol Naik

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply