Is there a way to customise messages produced by statements in MS SQL Query Analyzer?

Posted by Scott Leis on Stack Overflow See other posts from Stack Overflow or by Scott Leis
Published on 2010-05-04T07:14:34Z Indexed on 2010/05/04 7:28 UTC
Read the original article Hit count: 179

Filed under:
|

If I run a simple query in SQL Query Analyzer, like:
SELECT * FROM TableName
the Messages pane always produces a message like:
(30 row(s) affected)

If I run a stored procedure with many statements, the messages are useless because there's no indication of what each one relates to.

So firstly: Is there a way to customise the default messages on a per-query basis?
E.g. I'd like a specific query to produce a message like:
TableName query produced [numRowsAffected] results.
replacing [numRowsAffected] with the number that would have appeared in the default message.

Secondly, is there a way to suppress the default messages on a per-query basis?
E.g. I have a local variable of type TABLE, used in several statements.
I don't want any message to appear for statements where I'm just deleting data from that variable before re-using it.

I'm seeking solutions that work in SQL Server 8.0.

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about message