February 3, 2009 at 7:32 pm
Hi folks
Is there a SQL Server equivalent for Oracle's "set termout off"? This suppresses the output (display) of the SQL commands but not the actual execution.
If this is possible, can the terminal output be selectively suppressed for certain routines in the SQL script or is the entire script suppressed?
Thanks in advance,
Wayne
February 3, 2009 at 7:48 pm
Do you want to suppress results to an application or just within an SSMS session?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 3, 2009 at 8:03 pm
Just within the SSMS session. Thx.
February 3, 2009 at 8:21 pm
Well this works for any statements that return results. If you want to set this for all SSMS sessions, including new ones, when you open SSMS go to Tools -> Options -> Query Results ->SQL Server (or Analysis Server) -> Results to Grids (or Text) and select "Discard Results After Query Executes". This will set it for all Query Windows opened after you make the change and will keep that setting for SSMS.
You can also do the same thing to the currently active Query Window by going to Query -> Query Options -> Results -> Grid (or Text).
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 3, 2009 at 8:26 pm
I noticed this option, but figured that it would have global impact. It'd be great if there was a code option to discretionally suppress output within a SQL script/procedure.
Thx,
Wayne
February 5, 2009 at 2:54 am
SET NOCOUNT ON
???
The only DML returning a resultset is SELECT (without INTO).
N 56°04'39.16"
E 12°55'05.25"
February 6, 2009 at 9:07 am
I have the same issue.
I have an SP that executes a number of SPs used for generating report. What I want is to know how many records would be on the reports if I run them.
I get the @@rowcount of each called SP, but I want to suppress the actual results set.
The only way I have come up with so far (but not implemented) is
Each called procedure needs to take an additional parameter that is only set by the summary SP.
Each called procedure inserts its results set into a temp table.
If the summary parameter is set then the select from temp-table is not called, otherwise it is.
Not nice as each called SP will need to be amended and any new ones will have to follow the same logic
Obiron
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply