SQL Server Profiler不在SQL语句中显示数据

时间:2016-03-29 15:36:05

标签: sql-server sql-server-2008 nhibernate sql-server-profiler

我正在使用SQL Server Profiler来跟踪Windows SmartClient应用程序中从nHibernate生成的SQL。 SQL语句的跟踪不显示实际数据,而是如下所示:

exec sp_executesql N'SELECT attachment0_.RecordKey as RecordKey1_, attachment0_.Id as Id1_, attachment0_.Id as Id87_0_, attachment0_.RecordType as RecordType87_0_, attachment0_.RecordKey as RecordKey87_0_, attachment0_.FileName as FileName87_0_, attachment0_.OriginalFileName as Original6_87_0_, attachment0_.DateTimeAttached as DateTime7_87_0_ FROM MyDatabase.dbo.tblAttachment attachment0_ WHERE attachment0_.RecordKey=@p0',N'@p0 int',@p0=262

有没有办法在SQL命令中查看实际数据?

1 个答案:

答案 0 :(得分:1)

它只显示参数化的sql。如果你想记录或显示非参数化的sql,我想出了一个解决方案:

Execute NHibernate-generated prepared statements in SQL Server Management Studio

注意事项是log4net appender,它基本上在接受的答案中对此进行了翻译。