Search code examples
sqlnhibernateparameterized

Plain SQL output from NHibernate


I need: Plain SQL that I can run without modification with sqlcmd.exe to insert testdata into testdatabase.

I have: Service calls and entities to generate the insert operations with NHibernate.

Not working solution: Log output to text-file. NHibernate generates parameterized sql but logs them in a format not runnable by sqlcmd.exe.

Is there any way to force NHibernate to generate sql without parameters?

Or is there any better solutions to the problem?


Solution

  • depending on your schema, it may be easier to just generate INSERTs from the actual database, try using a utility like:

    Procedure to script your data (to generate INSERT statements from the existing data)