In SQL Server 2008 R2, admin users are allowed to view the Activity Monitor and under "Recent Expensive Queries", there is a list of SQL statements being ran on the server.
Is there a way to export each and every one of the SQL statements displayed without using SQL Server profiler?
I was given the responsibility of monitoring a database with many redundant tables and I have no idea which tables are actually in use.
I want to remove those dummy or unused tables and retain the productive tables.
Any suggestions on how to accomplish this?
sys.dm_exec_query_stats(and obviously withsys.dm_exec_sql_text). As for a way to directly import it form Activity Monitor? I don't think that's possible. But you could just work with the direct DMV to get the data. – Thomas Stringer Apr 6 '12 at 12:40