SSMS: Allow Multi-line Grid Results header values by respecting newline / CRLF in column name or alias
When needing to take a screen shot of results (for whatever reason, though for me it is usually to include in a blog post or forum answer), all columns need to fit on the screen as there is no opportunity for scrolling (it's just an image, not actual results). Sometimes there are several columns and not much space, so you can't waste any space (in terms of width) on what should be a meaningful column name for the header (so that readers can more easily understand the output without having to keep looking elsewhere (i.e. at the text) for what that column holds. By "wasted" space, I am referring to using more the minimum number of characters of width of the data being shown in the results for that column.
Example of "wasted" space (values are at most 2 or 3 "characters" wide):
<----- wasted ----->
Better would be:
It is currently possible to include a newline or CRLF in the column alias. In the past, this has gotten me closer to having a two-line header by using combining superscript characters on the 2nd line (bottom portion of the line is cut off, so the superscript characters mostly work as they are smaller and shifted to the top half of the 2nd line). For example, I used the following in a blog post:
SELECT NCHAR(0xD83D) + NCHAR(0xDC31) AS [Supplementary
a) this does not seem to work so much in SSMS 18.0
b) this was never a good option anyway since not all characters are available in combining superscript form (I got lucky that the only characters needed for the word "character" did exist).
This can be an option to enable/disable in:
Options -> Query Results -> SQL Server -> Results to Grid
The newlines already work to force a second line, I just need the header height to not be fixed at a single line.
P.S. I am not asking for the ability to respect newlines / have a dynamic cell height for the actual results, though if that were easy enough, then great, though that would need to be a separate option / check-box and not all or none. But for now, just enabling the header (which is in a fixed location, so it might be easier to accomplish, right?) to go multi-line would be super-awesome. Thanks 😺
P.P.S. the blog post mentioned above is: "All New Collations in SQL Server 2017 Implicitly Support Supplementary Characters" ( https://sqlquantumleap.com/2017/10/16/all-new-collations-in-sql-server-2017-implicitly-support-supplementary-characters/ ).
P.P.P.S. I have attached "before" and "after" pics related to that blog post, which hopefully clarify what I am talking about