Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Script run history Expand / Collapse
Author
Message
Posted Wednesday, October 17, 2012 3:00 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: 2 days ago @ 8:03 AM
Points: 230, Visits: 1,186
Morning all
Is there any way I can retrieve details about a script that was a run outside of a scheduled job?
Looking for duration times etc.
Are these recorded anywhere ?
Post #1373689
Posted Wednesday, October 17, 2012 4:42 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 3:04 AM
Points: 1,331, Visits: 15,269
Only if you are running a detailed trace.

In most environments capturing every script/query is a massive overhead simple because of the TPS.
Post #1373725
Posted Wednesday, October 17, 2012 8:10 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 8:22 AM
Points: 14,205, Visits: 28,534
You can get aggregate information about queries from the dynamic management objects (DMO), specifically by querying sys.dm_exec_query_stats. But, that assumes that the query is still in cache. If it's aged out of cache or recompiled since the time you were interested in, the information won't be there. But, it's not a history of all times that the query ran, just an aggregate.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1373811
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse