SQL SP Trace

  • Hi All ,

    How to trace sql sp without using print() statement ?

    Thanks in advance

  • What do you mean "trace"? Do you mean debug? there is no debugger in 2005. You can put the values or result sets into a table somewhere or you can use Profiler to see what is being run, but there is no debugger.

  • Matin (12/26/2008)


    Hi All ,

    How to trace sql sp without using print() statement ?

    Thanks in advance

    best way!

    run a server side trace and dump the output into a sql table

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • If you want to see each statement within a query as it executions use a trace (or Profiler on a non-production system), to capture the statement completion events :SP:StmtCompleted and/or SQL:StmtCompleted.

    This will capture each and every statement, so make sure you apply filters through the trace (or Profiler) so that you only see the activity that you want otherwise you'll collect way too much information.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply