SP:Stmtcompleted : SQL Profiler

  • Easiest question in the history of SQLServer Central but I cant find the answer and now Im confused !!!

    SP:Stmtcompleted = t-sql within a stored proc that has completed (great was simple I could live with that)

    so when I run this in ssms

    declare @sqlstr varchar(3000)

    set @sqlstr =

    'SELECT top 10000 [RowNumber],[EventClass]

    FROM [AdventureWorks2008].[dbo].test2

    order by eventsequence'

    exec (@sqlstr)

    why does it show as a SP:Stmtcompleted event in profiler (albeit with dynamic sql as the object name)

    Would imply not all SP:Stmtcompleted events are ran with in the contect of procs ?

    help !!

    ~si

    life is like a big unravelling cactus rug....

  • Interesting result. When I run this, it shows as SQL:StmtCompleted NOT SP:StmtCompleted.

  • shame I cant post a screen grab but I get

    2255, SP:stmtcompleted ,dynamic sql ,select top ...

    2256, sql:batch completed, null, delcare @sqlstr

    must be because its Friday ...

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

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