I have been doing SQL for a while and I’ve always been satisfied to use the Results to Grid found in SSMS.
Now I have a series of queries that I am running and I would like to have some very simple formatting of the results. Currently neither the Results to Grid nor the Results to Text do quite what I would like to do.
A few things I would like to do so it is easier for me to read is
- Remove the text that says ‘# row(s) affected’ (found in the
Results to Text) - Make the columns not so wide in the column aligned Output Format (part of the problem is that the Maximum Number of Characters does not appear to go below 30 – is this my data that forces this?)
If I cannot format the output (even to a text file) what other options do I have ?
I spent some time looking at SQL Server -> PHP -> HTML as well as SQL Server -> Reporting Services -> MS Report Builder but quite frankly it seems like overkill to put a few spacers and pretty up the headings a bit.
I feel like I am missing something here … I would rather not go through the hassle of all that installation of PHP and what not just to be able to look at my data a little bit prettier.
Put this
SET NOCOUNT ONat the top of your sqlYes its the size of the field that does this. You can cast it
cast(field as varchar(20)to make it smaller if you know you won’t lose data.