mar 16 anders jeppesen blog Microsoft CRM Microsoft CRM 2011 Scribe scripts T-SQL

Monitor Microsoft CRM Async log with Scribe

Use the script below to monitor the entries you have in the async log – you can make some rules based on how many days it have been waiting etc.

SELECT TOP (10000),



(SELECT DATEDIFF(DAY, startedonutc, GETDATE()) FROM FilteredAsyncOperation WITH(NOLOCK)WHERE asyncoperationid = MAIN_FilteredAsyncOperation.asyncoperationid) AS DayDurationInQueue

,CONVERT(char(10),startedonutc,126) AS DateEnteredQueue

FROM FilteredAsyncOperation AS MAIN_FilteredAsyncOperation WITH(NOLOCK)


statuscode IN(20,10,0)

AND name NOT IN(

'Update Contract States job'

,'SQM Data Collection'

,'Recurring Series Expansion job'

,'Goal Rollup job'

,'Delete completed system jobs'

,'Full Text Catalog job'


AND (SELECT DATEDIFF(DAY, startedonutc, GETDATE()) FROM FilteredAsyncOperation WITH(NOLOCK) WHERE asyncoperationid = MAIN_FilteredAsyncOperation.asyncoperationid) >= 1

ORDER BY DayDurationInQueue desc, statuscodename
Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+

Skriv et svar

Din e-mailadresse vil ikke blive offentliggjort. Krævede felter er markeret med *