November 14, 2019 at 6:13 pm
how can i see the last 100 select statements that were run by any user against a particular table?
Likes to play Chess
November 14, 2019 at 8:11 pm
Sorry,unless you have some auditing in place, before it happened, it is not possible.
you can get basically the last executed information for current connections from the DMV's, or using sp_whoisactive, for example, but not any history, SQL does not do that by default, you would have to add something for that, ad a monitoring tool, etc.
Lowell
November 19, 2019 at 4:02 pm
https://www.sqlservercentral.com/articles/making-good-use-of-sql-server-auditing-1
https://dba.stackexchange.com/questions/202357/log-all-sql-server-queries-with-their-durations
https://www.sqlshack.com/various-techniques-to-audit-sql-server-databases/
https://www.sqlshack.com/sql-server-auditing-server-database-audit-specifications/
HTH
-- webrunner
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply