Transform any Query to Html in T-Sql
A new management function in Sql Server 2012 can extract metadata from arbitrary queries. Paired with dynamic sql this allows to transform (almost) any query into a nice looking html table. This is particularly interesting if you want to send query results with Sql Server Database Mail. (Full solution with download)