SQLTeam.com | Weblogs | Forums

SQl Query


Hi. I need SQL query to get all tables in DB effected in last 15 minutes


This is not possible as stated. You can do it if you have tracing on, but it is not straight forward.


As @djj55 stated, the information is not available as it is. You can use SQL Profiler or trace to record all query for the required time frame. Output the result to a staging table and then query from that


DDL Changes can be tracked easily by using SYS.Tables

SELECT * FROM sys.tables
WHERE datediff(minute,modify_date,getdate()) < 16