Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Log of queries

Author  Topic 

lyxus
Starting Member

4 Posts

Posted - 2008-11-12 : 19:54:06

Hello folks,

I rembmer that i can see the queries that were executes in MSSQL at least the last ones ?

Can anyone tell me how to do that ?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-11-12 : 19:58:16
You can use sp_who, sp_who2, master.dbo.sysprocesses, DMVs, SQL Profiler, SQL Trace, and third party tools to see what is going on inside SQL Server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2008-11-13 : 00:43:56
SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
ORDER BY deqs.last_execution_time DESC
Go to Top of Page
   

- Advertisement -