Monday, 22 April 2019

How to find the script for the running process in the sql server.

In this post we are going to see how to find the script for the running process in sql server.

Replace the spid with the process id of the instance, how to get the spid click this link


DECLARE @sqltext VARBINARY(128)
SELECT @sqltext = sql_handle
FROM sys.sysprocesses
WHERE spid = 1         
SELECT TEXT
FROM sys.dm_exec_sql_text(@sqltext)

GO


From this post you are going to learn how to find the script for the running process in sql server.