1

Is it possible in "Nhibernate" to print generated sql queries with real values instead of question marks?

How would you suggest to print queries with real values if its not possible with hibernate api? Using log4j or the .net debugger or others.

All I find is for java already using hibernate but nothing for nbibernate and c.

Diego Unanue
  • 6,576
  • 8
  • 47
  • 67
  • Try nhibernate profiler http://www.hibernatingrhinos.com/products/nhprof – NMK Oct 06 '14 at 17:11
  • I gave an answer on Stack Overflow [here](https://stackoverflow.com/questions/42888947/how-to-get-sql-with-parameter-values-on-an-exception/42892191). – Michael Mar 27 '18 at 10:27

1 Answers1

1

Maybe not exactly what you are looking for, but just in case:

There are multiple parts of NHibernate that emit the SQL to the log. The logs emitted from the NHibernate.SQL logger will include parameter values. But yes, it will still be a parameterized query.

Oskar Berggren
  • 5,583
  • 1
  • 19
  • 36