Save and menage SSMS client messages

  • Hi guys,

    you know, there are some commands that generate client messages (those messages that are generated and shown inside the "result pane" along with errors).

    For example when you run a DB check you get a message that tells the number of allocation errors, consistency errors and so on..

    I know how to manage error warnings but I'd like also to intercept these messages and save them into a variable (or something else if needed) in order to enclose them to the mail body that my script sends at the end of the execution.

    I've searched a lot on the web but I could not find any topic about my problem.

    Has any of you ever had my same need and found a solution?

    Thanks,

    G.

  • I think this is a good solution.

    http://www.mssqltips.com/sqlservertip/1394/how-to-store-longer-sql-agent-job-step-output-messages/[/url]

  • The only problem is that it explains how to do this within a Job.

    I don't think it is possible to adapt this for SPs (or scripts outside Jobs).

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

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