Is it possible to check when a specific row was inserted into a specific table in SQL Server ? The table has an index if this any help.

And I need to do this for an existing table where the row has already being inserted.



To achieve this retrospectively you could do so by inspecting the contents of the transaction log to identify when the insert occurred, of course you need to have access to the relevant transaction log that contains the details.

Here is a walkthrough of how you would inspect the transaction log to locate a table drop event but the process you would follow is mostly the same.

If auditing of this level is actually something that's required then your best bet is to build it into your overall solution, whether through the use of DML Triggers, CDC or Change Tracking or a customised solution.


Transaction logs contain this info. You can use some third party tools to read transaction logs and transaction log backups. They can provide when the row was inserted for the transactions that had happened even before they were installed.

Besides the info when and what has happened, they can provide WHO has done it, which can be very useful

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.