info(query.dataSourceNo(1).toString());
And I get an ugly, long unformatted SQL, where I'm left pressing enter and tab a bunch to make the string somewhat readable.
After some light googleing, I came across an open source SQL Server Management Studio (SSMS) plugin called PoorSQL. It can also be done online, hooked to Notepad++, etc, but I prefer the plugin.
After pressing Ctrl+K,F, voila! So useful!
Download link and web link. Not sure why they have different main URLs:
- Download - http://architectshack.com/PoorMansTSqlFormatter.ashx#Download_5
- Web URL - http://poorsql.com/