Execution of stored procs

  • hi guys,

    i write stored procs and i want to look at how stored proc is being executed inside.

    do i need to use Sql Profiler and how to?

    your reply is much appreciated.

    thanks

    regards,

    ts

  • SQL Profiler would be ideal to monitor any activities on SQL Server.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • I believe it is possible to actually trace the running of the code in a similar manner to how one would do so with .NET code in Visual Studio.

    However, I have never done it myself. Would someone out there share some thoughts on this?

    This was even possible with the SQL 2000 tools, from what I have heard from colleagues, although I never tried it myself.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • On the subject of SQL Profiler, SP:StmtCompleted should be one of the events to monitor.

    __________________________________________________________________________________
    SQL Server 2016 Columnstore Index Enhancements - System Views for Disk-Based Tables[/url]
    Persisting SQL Server Index-Usage Statistics with MERGE[/url]
    Turbocharge Your Database Maintenance With Service Broker: Part 2[/url]

  • I'm not sure, but it sounds like you might be talking about execution plans? These show what the optimizer and query engine will do with the code that you wrote. Is that what you meant? If not, I think you might be talking about debugging a stored procedure. That means stepping through it line by line. Please clarify which you're interested in because they've got two different sets of approaches.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • hi,

    It is a debuging of stored procedure line by line

    and want to visual the result set.

Viewing 6 posts - 1 through 5 (of 5 total)

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