Is there a way to customise messages produced by statements in MS SQL Query Analyzer?
- by Scott Leis
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.