Forum Discussion

rmerritt's avatar
rmerritt
Tin Contributor
Oct 26, 2024

Stored Proc is running , is there anyway to see what database it is working on

Stored Proc is running , is there anyway to see what database it is working on?

the script is Ola Helgren's IndexOptimization on all user databases. I tried using sql profiler but nothing usefull came of it.

2 Replies

  • Mike_Lemay's avatar
    Mike_Lemay
    Tin Contributor

    If it is optimizing indexes you can usually catch them running in the "Active Expensive Queries" pane in the Activity Monitor on SSMS.  Each query being run to optimize will usually show up there.

  • olafhelper's avatar
    olafhelper
    Bronze Contributor
    No, you can only see the name of the procedure, but not which line of is currently running, nor the cross-database access.
    You have to implement a logging in your code.