This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Custom alert if table has NOT been updated?

Is there a way to setup a custom alert if a table has not received any new input? I'm using MSSQL and the latest version of DPA.

I'm having a difficult time even understanding the different types of alerts. From what i can figure it looks like we can only get a custom alert if it can be ranked by high, low, etc.

Thanks for any help/guidance

mh

Message was edited by: m henry changed reports to alerts. If I missed any, I'm asking about alerts only.

Parents Reply Children
  • ok, so I'm trying this query but it doesn't work. Says that "An expression of non-boolean type ... near "AND"

    I picked the Custom SQL Alert-Single Boolean Return as the type and left the default of "Use Repository Default" as the notification policy.

    I really have no idea why this isn't working. Got any ideas?

    SELECT CASE WHEN EXISTS(

    SELECT field FROM table WHERE getdate()-0.02083 AND taker IS NOT NULL)

    THEN CAST(1 AS BIT)

    ELSE CAST(0 AS BIT)

    END

  • Do you have a field that gets updated with a current timestamp upon inserts? Might be an easier way to tackle this.

  • Looks like I do. I just started working on this database, but there are three columns in this table. We have date_created, date_last_modified and one called date_order_completed. I may have to play with it a bit but I'm sure one of those will work.

    Let's use date_created for whatever you have in mind.

    Thanks,

    mh

  • So that got me thinking. I changed it up a bit and used this. And it worked!

    SELECT CASE WHEN EXISTS(

    SELECT field FROM table WHERE date_last_updated > getdate()-0.02083 AND field IS NULL)

    THEN CAST(1 AS BIT)

    ELSE CAST(0 AS BIT)

    END

  • I was thinking something like this then:

    select datediff(mi,(select max(date_created) from table)),getdate())

    and use that value to compare with thresholds since it will be a numeric.

    So set warning between 15 and 30 minutes and critical over 30 for example. Set the alert to run at 15 minute intervals to keep overhead low.