我们正在使用nHibernate它从.NET代码生成查询。有时,某些查询会卡在sp_whoisactive列表中,我们无法找出原因。我有一种感觉,它与丢失或损坏的参数有关。sp_whoisactive但是,当我运行时,我只看到参数名称(在示例中:)@p0,而不是实际值。有没有办法在进程仍在运行时检索此信息?
例子:
SELECT
this_.Id as Id6_2_, this_.HRNumber as HRNumber6_2_,
this_.FirstName as FirstName6_2_, this_.LastName as LastName6_2_,
this_.StatusTypeID as StatusTy5_6_2_,
this_.PropertyId as PropertyId6_2_, this_.DepartmentGroupId as Departme7_6_2_,
property2_.PropertyID as PropertyID10_0_,
property2_.PropertyCode as Property2_10_0_,
property2_.LMSCode as LMSCode10_0_, property2_.PropertyName as Property4_10_0_,
property2_.Report as Report10_0_, department3_.Id as Id4_1_,
department3_.Name as Name4_1_, department3_.DisplayName as DisplayN3_4_1_
FROM
[dbo].[EmployeeDepartmentGroupView] this_
LEFT OUTER JOIN
[dbo].[Property] property2_ ON this_.PropertyId=property2_.PropertyID
LEFT OUTER JOIN
[dbo].[DepartmentGroup] department3_ ON this_.DepartmentGroupId=department3_.Id
WHERE
this_.HRNumber LIKE @p0;
Run Code Online (Sandbox Code Playgroud)
请注意,这是从 …