我正在使用
linq to Entity来查询azure数据库.
我已登录azure查看给出特定问题的查询.我想实际查看传入的参数,但所有azure给我的是下面.有没有办法在查询已经运行后查看参数(例如,更改代码以记录它们不是一个选项).
我已登录azure查看给出特定问题的查询.我想实际查看传入的参数,但所有azure给我的是下面.有没有办法在查询已经运行后查看参数(例如,更改代码以记录它们不是一个选项).
当我登录azure时,请转到管理门户 – sql数据库|查询性能|选择特定查询.
我可以看到以下内容:问题是我无法看到已经传递给参数的内容,例如@ p_linq_19.我只看到一个参数占位符.
SELECT TOP (150) [Project1].[AlertIdentifier] AS [AlertIdentifier] FROM ( SELECT [Extent1].[AlertIdentifier] AS [AlertIdentifier],[Extent1].[TimeReceived] AS [TimeReceived] FROM [dbo].[SecurityAlert] AS [Extent1] WHERE (2 <> [Extent1].[AlertStatusID]) AND ((convert(datetime2,'0001-01-01 00:00:00.0000000',121) = @p__linq__0) OR ([Extent1].[DateScanned] >= @p__linq__1)) AND ((N'' = @p__linq__2) OR ([Extent1].[BettingShopIdentifier] LIKE @p__linq__3 ESCAPE N'~')) AND ((convert(datetime2,121) = @p__linq__4) OR ([Extent1].[DateScanned] <= @p__linq__5)) AND ((cast(0 as float(53)) = @p__linq__6) OR ( CAST( [Extent1].[SlipStake] AS float) >= @p__linq__7)) AND ((@p__linq__8 < 1) OR ([Extent1].[SlipStatusID] = @p__linq__9)) AND ((cast(0 as float(53)) = @p__linq__10) OR ( CAST( [Extent1].[SlipPayoutActual] AS float) >= @p__linq__11) OR ( CAST( [Extent1].[SlipPayoutCalculated] AS float) >= @p__linq__12) OR ( CAST( [Extent1].[SlipPotentialReturn] AS float) >= @p__linq__13)) AND ((N'' = @p__linq__14) OR ([Extent1].[AlertSummary] LIKE @p__linq__15 ESCAPE N'~')) AND ((N'' = @p__linq__16) OR ([Extent1].[StaffScannedByUsername] LIKE @p__linq__17 ESCAPE N'~') OR ([Extent1].[StaffPayoutUsername] LIKE @p__linq__18 ESCAPE N'~') OR ([Extent1].[StaffEditedByUsername] LIKE @p__linq__19 ESCAPE N'~')) ) AS [Project1] ORDER BY [Project1].[TimeReceived] ASC
解决方法
我会选择miniprofiler选项.您可以在此处下载它:
http://miniprofiler.com/并将其配置为配置您的sql连接.