Home > front end >  Add a line break in sqlcmd output
Add a line break in sqlcmd output

Time:10-20

I am working with SQL Server 2019 on Windows. I have a SQL script (.sql file) which I run from the command prompt using sqlcmd.

This is the script:

use master
go
select '$(SQLCMDWORKSTATION)' 'SQLCMDWORKSTATION';

When I run it I get the output:

Changed database context to 'master'.
SQLCMDWORKSTATION
-----------------
HP-ABC-DE-01

In the output I want to put an empty line after "Changed database context to 'master'". How can I do that?

CodePudding user response:

Add a PRINT ''; just after the GO statement.

  • Related