How can we help you today? How can we help you today?

SQL Monitor - Long Running Query Alert.

SQL monitor, the alert for long running queries. i am trying to exclude jobs or queries that contain the following keywords. I separate them using | but that does not seems to work. And i know very little about regex.

So obviously the | separator is not working for me, could someone tell me the correct syntax please?

JOBS
UpdateStats
ReIndex

QUERY KEYWORDS
Index
Statistics

Below is what I have.

Ian Keogh
0

Comments

5 comments

  • Tom_C

    Hi Ian,

    Sorry this doesn't look to be working for you.

    I would suggest putting these on separate lines and seeing if this makes any difference rather than using the  |  alternation.

    Please let us know if this still doesn't look to be working as desired.

    If you haven't already seen from the help window in the UI, here are some helpful links on RegEx:
    https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference

    https://regexlib.com/CheatSheet.aspx

     

    Tom_C
    0
  • ThomasBE
    You have to use 'ALTER INDEX' instead of 'INDEX'. 
    Mine is configured like:

    ThomasBE
    0
  • IanKeogh
    Thank you, I have made that change. I believe that should do the trick.
    IanKeogh
    0
  • marclen
    ThomasBE said:
    You have to use 'ALTER INDEX' instead of 'INDEX'. 
    Mine is configured like:


    Thank you, i searched for that
    marclen
    0
  • SEarle86
    FWIW, I have this in place which seems to be working well:

    ^BACKUP DATABASE
    ^BACKUP LOG
    ^RESTORE DATABASE
    ^RESTORE LOG
    DBCC CHECKDB
    SEarle86
    0

Add comment

Please sign in to leave a comment.