Return messages from EXEC SQL Statement to file or variable

  • If I run a set of SQL statements in SQL management Studio I can return the results of SQL query statements to a grid while getting record counts, print messages and errors on the messages TAB. I want to store the messages tab dircetly to a file - but still show the query results in a grid. Can this be done?

  • Hi craig

    No, that's not possible. The vice versa could probably be done with SQLCMD mode.

    Greets

    Flo

  • craig-962225 (8/17/2011)


    If I run a set of SQL statements in SQL management Studio I can return the results of SQL query statements to a grid while getting record counts, print messages and errors on the messages TAB. I want to store the messages tab dircetly to a file - but still show the query results in a grid. Can this be done?

    May be you can use try-catch block and raise an error using raiseerror to log the results in the error log file and application event log.

    But this can be done for errors only.. not for successful executions..



    Pradeep Singh

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

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