Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Finding out the slow SQL from huge stored procedure

$
0
0

Hi All,

I am on SQL 2000 (no dm_ views etc etc).

There is a stored procedure which sometimes run in 40 mins, but sometimes it might take anything between 2 hours and 8 hours. It is a reasonably big stored procedure with cursor loops, lot of if-than-else and all sorts of things you can see in a complex stored procedure.

I want to find, which perticular SQL(s) are taking more time when the stored proc runs slow. How can I do that ?? what tools can I use to do this SQL 2000 ?

I am not a DBA which has all permissions on the database. I was planning to use master..sysprocesses to see which SQL is being run, but get the SQL text from sql handle looks like tricky job. I can use fn_get_sql, but I do not have permissions to run this function.

Your thoughts please.

Thanks in advance.


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>