Message window to SSIS string variable

  • Hi all,

    If I run a SQL statement or execute a stored procedure from SQL Mgmt Studio, I will get two tabs: Results and Messages.

    In SSIS, normally "Results" is returned to a data flow, execute task, etc. I am interested in returning whats in the messages window to a SSIS string variable which will then be emailed out. I won't have problems with returning it to the variable or emailing it out, but I'm unsure of how to access this information in my Execute SQL task (or dataflow). Once I am able to figure out how to access this, I can just save it to my string variable.

    Is there a way to do this?

    Thanks,

    Strick

  • That would depend on how you're generating the messages. Are you talking about the number of rows affected and "Query Completed", or about custom messages from the proc?

    You can't, to my knowledge, directly access the messages. But their data can certainly be put into something like an output parameter or a recordset.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Hello,

    Thanks for your response. I am looking to access the message itself. Basically I want EXACTLY what's on the message tab word for word as if I ran my SQL statement or stored procedure from SQL Mgmt Studio.

    Strick

  • That data comes from Management Studio, so far as I know. Not from the database itself. I don't think there is a way to access it. Could be wrong, but I don't think so.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 4 (of 4 total)

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