Search code examples
sqlsql-serversql-server-2008sqlcmd

How can I set the maximum number of characters per column using sqlcmd?


While using SQL Server Management Studio, I generally do:

Query->Query Options->Advanced->SET NOCOUNT
Query->Query Options->Text->Enter 8000 in the lower right box

Can someone please tell me if there is anyway I could do this using sqlcmd?


Solution

  • You have these switches for sqlcmd that affect width etc

    • -w
    • -Y
    • -y