Meroz
Meroz

Reputation: 889

SQLCMD is showing tables not in pretty way

I want to have access from time to time to my SQL Server database from the command line or linux terminal, but I encountered problem with reading results. It seems that tables are to wide what makes it unreadable. It there a way to define columns width?

enter image description here

Upvotes: 0

Views: 513

Answers (1)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239664

In a command prompt, you can make the window buffer wider and then the system can make use of that width: enter image description here

You access the above by right-clicking within the command prompt's title bar and choosing "Properties".

And here's a prompt where I ran the same query twice, adjusting the width (as above) between the two:

enter image description here

I would imagine that there are similar settings available in powershell (should be exactly the same, so far as I'm aware) and in Linux terminal windows also.

The alternative would be to be more selective in your queries (fewer columns) and use of SUBSTRING to limit the width of your selections, such that they fit within 80 columns (default command prompt width)

Upvotes: 1

Related Questions