Friday, 27 January 2012

Using NHibernate to format your SQL

Just did this in the immediate window from break point set in Abstract Batcher, GetSQL method in the NHibernate source code



"exec [dbo].[GetProjectComments] ?"

SqlClientDriver driver= new SqlClientDriver();

SqlStringFormatter formatter = new SqlStringFormatter(driver);


Expression has been evaluated and has no value


"exec [dbo].[GetProjectComments] @p0"

Thinking of using this to write a custom little app on the side to make all my SQL look nice again. I know SQL Prompt already does this nicely, but don't have a license for that right now, so this is a nice free alternative I guess.

No comments:

Post a Comment

How to replace the watch battery in Logitech K750 solar power keyboard

Buy this battery Open the battery cover on the back of the keyboard, you’ll need...