I use Microsoft SQL Server to maintain the data which received from other software (Smartplant Instrumentation). I want to know the last table which was updated and inserted by the data from the other software.
I used this query, but I didn't get the correct updated tables:
SELECT
SCHEMA_NAME(9),
name AS table_name,
create_date,
modify_date
FROM
sys.tables
WHERE
modify_date > DATEADD(DAY, -30, CURRENT_TIMESTAMP)
ORDER BY
modify_date DESC;