Hi All,
Im just wondering if there is any way to get the last SQL Stmt or SP that was run on the server without using the SQL Profiler or third party software.Thanks and have a nice day to all.No. There is really no easy way to determine this information. And do you want last SQL statement or SP executed by any connection? Or is it the last on the server? In some cases, you could use DBCC INPUTBUFFER with the currently executing or inactive SPIDs but this is not entirely accurate. And if the connections have disconnected from the server then there is really no record. You could look at the cached plan entries but there is no way to relate them in order of time and you will miss statements that were not cached for example. What are you trying to do with this information though? What do you want to determine from knowing the last command that was sent to the server?|||
Thanks for the reply.
Just only wondering if there is any alternate way using sql stmt on SQL Query Analyzer by not using the SQL profiler to get the SQL stmts.
No comments:
Post a Comment