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.
Author |
Topic |
jar21
51 Posts |
Posted - 2010-01-11 : 14:28:15
|
Is there a way to view queries that were ran directly from the sql management studio on the server itself?Enjoy Life This Is Not A Rehearsal. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jar21
51 Posts |
Posted - 2010-01-11 : 14:38:29
|
what about completely after the fact? they've been ran this morning and yesterdaY?Enjoy Life This Is Not A Rehearsal. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2010-01-11 : 14:59:07
|
See if this is usefulhttp://searchsqlserver.techtarget.com/generic/0,295582,sid87_gci1265214,00.html#You might change the below to serve your need.SELECT TOP 10 SESSION_ID, LOGIN_TIME, HOST_NAME,PROGRAM_NAME, LOGIN_NAME, NT_DOMAIN, NT_USER_NAME, STATUS, CPU_TIME, MEMORY_USAGE, TOTAL_SCHEDULED_TIME, TOTAL_ELAPSED_TIME, LAST_REQUEST_START_TIME,LAST_REQUEST_END_TIME, READS, WRITES, LOGICAL_READS, TRANSACTION_ISOLATION_LEVEL, LOCK_TIMEOUT, DEADLOCK_PRIORITY, ROW_COUNT, PREV_ERROR FROM SYS.DM_EXEC_SESSIONS ORDERBY MEMORY_USAGE DESC-Shan |
 |
|
jar21
51 Posts |
Posted - 2010-01-11 : 15:43:07
|
Very cool on both replies thanks! |
 |
|
shan
Yak Posting Veteran
84 Posts |
Posted - 2010-01-11 : 15:57:06
|
You are welcome...-Shan |
 |
|
|
|
|
|
|