SSMS Query Window Too Short

Jim Stiene 60 Reputation points
2024-01-19T20:29:46.86+00:00

Is there a way to make the query window in SSMS taller? When I pull down on that updown arrows on the right side of it, it just replicates the short window. I managed to set it to wrap but it's still a very short cell. Maybe I just need to remove those lines that make it look like a cell?

SQL Server Other
{count} votes

Accepted answer
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2024-01-21T14:31:16.91+00:00

    Yes, you can turn off the gray borders that highlights the current line:

    User's image

    If you want your ultra-long lines, I guess you need to turn on word-wrap. But as you note yourself, it's difficult to spot where the errors are since SQL Server only gives line numbers, not column numbers.

    And, yes, with 200 columns in table that's a tall CREATE TABLE statement. Then again, 200 columns in a table is quite impractical from more than one perspective.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2024-01-20T10:02:04.51+00:00

    It's hard to say what happened, since you did not share a screenshot which show this situation with the query window being "about the height of a cell in Excel". It would also help if the screenshot shows the full SSMS window.

    But some remarks:

    1. When you run a query and get one or more result sets, you get the result sets in the lower part of the window, and there is a bar that you can drag up or down to expand what you see. If you don't like this arrangement, there is an option to have the result sets in a separate tab. (I use this setting myself.)
    2. To the right, at the top of the scrollbar, there is a splitter, so that you can split the query window in two. This can be useful if you have a long file, and you need to see a table definition in the beginning of the file, while you are working several hundred lines down. Again there is a bar you can drag up and down, and if you drag it to the top it disappears.
    3. Having a CREATE TABLE statement with that man columns on a single line is not a good idea in my opinion. I typically have a line break after each column in CREATE TABLE. Overall, I don't like very wide lines as they are more difficult to read.

  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2024-01-21T13:20:51.5666667+00:00

    To answer Erland, Mine doesn't look like yours. It looks like this

    I would say that it looks very much like mine. Try pressing Carriage Return to get to the new line. (But you can't get below the last line in the window, even if you have virtual space enabled. I swear over this about daily.)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.