Hi,
When I am working with NHibernate (I am a beginner of it btw) I am able to obtain the SQL calls to Db in my output. But I am not able to make them work after I copy and paste into Management Studio.
Because it is missing the parameter declarations.
I get something like:
SELECT this_.PK_Product as PK1_1_0_, this_.ProductCode as ProductC2_1_0_
, this_.ProductName as ProductN3_1_0_, this_.ProductCodeISO2 as ProductC4_1_0_
, this_.NotUsed as NotUsed1_0_, this_.Confirmed as Confirmed1_0_, this_.LabelRequired as LabelReq7_1_0_ FROM tProduct this_
WHERE (this_.NotUsed = @p0 and this_.Confirmed = @p1 and this_.LabelRequired = @p2);@p0 = False [Type: Boolean (0)], @p1 = True [Type: Boolean (0)], @p2 = False [Type: Boolean (0)]`enter code here`
When I execute this in my SQL Management Studio, I get an error:
Msg 137, Level 15, State 2, Line 1 Must declare the scalar variable "@p0".
Can I somehow tell NHibernate to add parameter declarations in the created query string?
Thanks