Tuesday, July 16, 2013

TSQL statement of running queries

In a SQL production environment it can happen that you see heavy transactions. With next query you can retrieve the TSQL statement of a process you see in master..sysprocesses.

SELECT Text,hostname, program_name, nt_username,*
FROM Master..sysprocesses
CROSS APPLY sys.dm_exec_sql_text (sql_handle)
WHERE Spid > 50


You can extend the WHERE clause with SPID = XX or something else you wnat to filter on.

1 comment:

Enndery Ashwin said...

A well-written medical school personal statement is your first initial "interview" when applying. Here are some important things to consider that make your admissions packet stand out from the rest. research statement biology