SQL Server Management Studio and its lies

It has come to my attention that the Results window (in Grid view) in SQL Management Studio doesn’t always display when there is data in a given column. So far, I have only noticed this occurring when null characters exist in the column, but it may also occur for other non-printable characters.

For example, note the following query vs. the result:

Row 5 illustrates the difference. If I run the same query in ‘Results to Text’ mode, I get the following:

Note that neither of these actually show the characters that are causing the discrepancy; in the latter case, the bad characters are replaced with spaces, so even copying out of the results window or exporting to file will not let you know why Grid view does not look right. However, this does give more information about what is in the row than is shown via the grid view.

Leave a Reply

Your email address will not be published. Required fields are marked *


− 1 = five

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">