Tag: SQL server (Page 1 of 3)

T-SQL script to find active processes in SQL Server 0 (0)

SELECT SPID = er.session_id
,DBName = DB_Name(er.database_id)
,Host = ses.host_name
,STATUS = ses.STATUS
,BlockBy = er.blocking_session_id
,CommandType = er.command
,ObjectName = OBJECT_NAME(st.objectid)
,CPUTime = er.cpu_time
,StartTime = er.start_time
,wait_type =er.wait_type
,last_wait_type =er.last_wait_type
,TimeElapsed = CAST(GETDATE() – er.start_time AS TIME)
,SQLStatement
Read the rest

« Older posts

© 2024

Theme by Anders NorénUp ↑