Nhibernate generate plain sql query instead of execution statement
- by Wei Ma
Using SQL profiler, I was able to find the query generated from Nhibernate was executed in the
EXEC sp_executesql N'select ...'
fashion.
I am wondering if there is any way to force Nhibernate to generate the plain
Select ...
statement instead.
The reason I want this is because apparently SQL Server generated different execution plans for them, and in my scenario, the plain "select ..." runs MUCH faster.