Just did this in the immediate window from break point set in Abstract Batcher, GetSQL method in the NHibernate source code
sql.ToString()
"exec [dbo].[GetProjectComments] ?"
SqlClientDriver driver= new SqlClientDriver();
SqlStringFormatter formatter = new SqlStringFormatter(driver);
sql.Visit(formatter)
Expression has been evaluated and has no value
formatter.GetFormattedText()
"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