Skip to main content

How to not display the column header in the output of a MS SQL Script?

Posted in

If you are using the SQLCMD utility and want to avoid or suppress the column header in the output of SQL Script. You can do it just by setting the Variable  SQLCMDHEADERS to -1  by default its 0

 

Setting the variable to -1 suppresses the column header in the output. Also if you want the Column header to be inserted after a certain number of records, you can do so by setting the variable to that value.

 

Eg.

:SETVAR SQLCMDHEADERS -1   (will suppress the column header)

:SETVAR SQLCMDHEADERS 10  (will insert column header after every ten records)

 

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.