sqlcmd - view

how can i change the view in sqlcmd?

such as changing the font or the window size so that a command such as sp_tables will list on one row rather than several. Also I would only like to see 10 records or so at the same time. Currently in default setting, if i run sp_tables I can really only view the last few records.

thanks!

[348 byte] By [JeffreyE.Moeller] at [2008-2-14]
# 1

Font size, window size, etc are controled by the Command Window, not by SQLCmd, so you'll need to change it there. Right-click on the Titlebar of the command windows and choose Defaults or Properties.

Beyond that, there is little you can do to control the output. When you run a command in SQLCmd, you'll get your entire result set back. If it's too wide, it will wrap, if it's longer than your screen, it will scroll. If there is more data than the command window buffer holds, you'll loose data off the top of the buffer. Some alternatives are:

  • Scope your queries so less data is returned or fewer columns are returned.
  • Run your output to a file rather than the screen.
  • Use a GUI query tool such as Management Studio Express which is currently available as a CTP. (http://msdn.microsoft.com/sql for more information.)

Additional help on SQLCmd switches (to learn how to send results to a file) are at http://msdn2.microsoft.com/en-us/library/ms165702.aspx.

Regards,

Mike Wachal
SQL Express team

MikeWachal-MSFT at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...

SQL Server

Site Classified