Re: select 'message'; not appearing



Jeff Kish (jeff.kish@xxxxxxx) writes:
I am trying to add some debug to a stored procedure.

I put some statements like this throughout the code:

select 'some message here';

but I never see them.
I put them in a test procedure that works fine, so that I have a feeling
that when an insert fails in a down-stream try catch block, it messes up
the display of the information.

Can someone tell me how to best go about outputting debug I can see from a
stored procedure, or if I am even correct about try catch blocks throwing
errors, messing up the debug visibility.

I don't have any experience of the TRY-CATCH block messing up the output.
If the debug SELECT does not appear, my interpretation is that the
SELECT statement is never executed. That is, you never reach that part
of the code.

Seeing the actual code would make it easier to say what is going on.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: Debugging Stored Procedures with Query Analyzer
    ... When trying to debug a stored procedure with query analyzer it does not ... SQL Server is on the same machine. ... First check in Help->About in Query Analyzer which version of QA you have. ... Books Online that may give further tips. ...
    (microsoft.public.sqlserver.tools)
  • Re: Query Analyzer Debuging
    ... They put SP4 on the SQL server and debugging is so ... I hope it is not such a mission to debug in SQL 2k5. ... SQL Server Management Studio. ... Books Online for SQL Server 2005 at ...
    (microsoft.public.sqlserver.tools)
  • Re: testing with sql server
    ... Regarding your SQL Server 2000 debugging problems, ... version to debug with a sql server 2000 database. ... My goal is to debug some t-sql commands. ... attach to a process and the process that I need to attach to is ...
    (microsoft.public.sqlserver.setup)
  • Re: Query training -- Complex queries
    ... > Update PositionsEOM ... Here you don't have a derived table, but a correlated subquery. ... UPDATE in Books Online. ... is not written for SQL Server. ...
    (microsoft.public.sqlserver.server)
  • Re: Can i debug/watch on the triggers INSERTED and DELETED records/values?
    ... > Sometimes I do debug remotely. ... we found that debugging did not work when you had Windows ... Now, port 135 is not any port: ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)