MSSQL How to find out which table a record has been included or modified

Asked

Viewed 1,305 times

1

There is a way to find out via query which table in a database has changed from Update or Insert?

  • 1

    Your question is not clear. Explain the problem so we can propose a solution.

  • There are Triggers (Triggers)

  • https://docs.microsoft.com/pt-br/sql/relational-databases/security/auditing/sql-server-audit-database-engine

1 answer

0

By checking the SQL SERVE forums, this query will return the value of the last Insert:

SELECT o.name as ObjectName, last_user_update,*
FROM sys.dm_db_index_usage_stats s
join sepm01.sys.objects o on s.object_id = o.object_id
WHERE database_id = DB_ID( 'sepm01')

Also I found a component that will give you a more precise mtrack on this: SQL Server - Change Tracking

Browser other questions tagged

You are not signed in. Login or sign up in order to post.