Thursday, January 28, 2021

Get SQL Text from SPID

 DECLARE @sqltext VARBINARY(128)

SELECT @sqltext = sql_handle

FROM sys.sysprocesses

WHERE spid = 91

SELECT TEXT

FROM sys.dm_exec_sql_text(@sqltext)

GO

No comments:

Post a Comment