Friday, February 10, 2012

Coming from Sybase

Coming from Sybase env. I would like to know the equivalent of sp_showplan. What it does is, it shows the showplan for the query being run by spid, which is passed as a parameter to sp_showplan.
Thanks for your help.I think that SET SHOWPLAN_TEXT (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_set-set_93sk.asp) is about a close as you are going to get. The SQL Profiler allows you to get plan information as the SQL is submitted to the server, but I don't know of any way to retroactively see the plan generated by another spid even if you are a member of the sysadmin group (Microsoft's equivalent to Sybase's sa).

-PatP|||In that case, how would you check the performance issue with a third party front end application running on MS SQL Server. Only thing you know is SPID with which the application is running - either a report or a batch job. I tried SQL profiler, but couldn't get anything in the output. I might be missing something.

Appreciate all your help.

Thanks.|||When you set up the trace file, under the Performance class add one of the Show Plan events. Tracing those events will show you many times more than what sp_showplan could.

-PatP

No comments:

Post a Comment