When executing a query in linq, my nhibernate debug log shows me it uses a parameter @p0 to represent a value in the WHERE clause in the generated SQL. This takes about 1 minute.
When I run the same query (a simple select with WHERE Campaign = 500) in SQL Server Management Studio, this query takes 1 second.
When I DECLARE @p0 int & SET @p0 = 500 and then use WHERE Campaign = @p0, the query takes 1 minute as well...
Is there a way to make nHibernate "translate" the @p0 into 500 before it gets executed on my database?