Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 something about system procedures

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2005-06-17 : 14:42:51
Is there any sp or query that u can use to get all the detail of execution plan if u have a list.especially to find out the slow executing stored procedures

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-17 : 14:49:33
No such system stored procedure exists. You can use SQL Profiler to find out which queries/stored procedures are running slowly. You can also record the execution plans for these if you add that event to your trace.



Tara
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2005-06-17 : 15:16:29
But can we run some queries to know what exactly the cost estimation and all as we get from the execution plan
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-17 : 15:17:54
No. You'd need to run SQL Profiler to do this. Save the trace results to a SQL Server table. You can then query the table.

Tara
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2005-06-17 : 15:26:41
Just out of curiosity...Before the display of execution plan it has to be stored in a system table or temp table and can we query that to get all the cost estimation needed.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-17 : 15:35:33
No. SQL Profiler is the answer for this. Why are you reluctant to go down this route?

Tara
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2005-06-17 : 16:06:37
SO that on one query I will be able to get the slowest sp written
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-17 : 16:09:06
Yes. SQL Profiler will be able to do this for you. Collect the data. Then:

SELECT TOP 1 Duration, TextData
FROM TraceTableName
WHERE TextData IS NOT NULL
ORDER BY Duration DESC

Tara
Go to Top of Page
   

- Advertisement -