October 26, 2005 at 4:27 am
Hi,
See the following procedure.
Create procedure test
as
begin
declare @test-2 varchar(8)
set @test-2 = 'Hello'
print @test-2
set @test-2 = 'hi'
print @test-2
select @test-2
return
end
The result: 'Hi'
How can I see the results of print statements?
Also, When I run the profiler, it shows only the statements executed. It wont show the result of the statements. How can I see that?
For example, how to check result of "print @test-2" in sql profiler?
-Pallavi
October 26, 2005 at 4:59 am
I can't repro that - I get these results when running the proc in QA:
Hello
hi
--------
hi
(1 row(s) affected)
Profiler only shows you what the server sees - that is what commands are sent to the server. It's an audit facility, not a debugger.
/Kenneth
October 26, 2005 at 5:48 am
If you are running it with "Results in Grid" active then the result of SELECT @test-2 will be in the grid, and the two print statements are printed to the Message tab. If you are using "Results in Text" then everything is found in the Results tab (that has only text), exactly as Kenneth showed above.
October 26, 2005 at 6:36 am
Hi,
Thanx.. )
Is there any way by which I can see the result of each executed sql statement in profiler or in any other utility?
October 26, 2005 at 7:02 am
Well - results in text (as Chris explained above) should allow you to see all the results...is that not what you're asking for ?!
**ASCII stupid question, get a stupid ANSI !!!**
October 26, 2005 at 8:38 am
If you are writing your own client you can get the print statements as informational messages. See my blog for more info on getting InfoMessages.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply