Hi all
I love the feature in NHibernate that shows the generated SQL. But when I pasted it into SQL Server Management Studio, I realised it's not actually valid!
Here's an example:
SELECT person0_.PersonId as PersonId1_0_, person0_.Title as Title1_0_, person0_.FirstName as FirstName1_0_, person0_.MiddleNames as MiddleNa4_1_0_, person0_.LastName as LastName1_0_ FROM Kctc.People person0_ WHERE person0_.PersonId=@p0;@p0 = 1
This is not valid because of the way the parameter p0 is specified. It needs:
DECLARE @p0 int
SET @p0 = 1
before the SELECT command.
I guess my question is: why does NHibernate not show the ACTUAL SQL it sends to the database? Why does it show this instead?
Is there something I'm missing?
Thanks
David