0

I need to know the best way to monitor a SQL server DB table if it is updated everyday or not. If it is not updated on a particular day, then send an alert message to a particular mail.

  • SQLServer has change tracking; you don't need to roll it yourself. https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-tracking-sql-server?view=sql-server-ver15 – Caius Jard Dec 21 '21 at 09:24

1 Answers1

0

Create a job on SQL Server Agent that runs every day. On that job, design a script that checks if the table is updated.

To check if the table is updated, you should do something like save the value of a particular column from the previous day and compare it to the value of n from the current day. Or you can design a trigger on that table. If the table is updated, the trigger will fire and save somewhere the fact that the table was updated.

If the table is not updated send an email. If you don't know how to sent an email from SQL server here are the steps you should follow:some steps

  • Thankyou so much Daniel but could you please provide the implementation part e.g. how to create the job and how to design a script that will handle this as I am quite new in SQL Server. Thank in advance – Gaurav Singh Dec 22 '21 at 05:40