Reputation: 6372
I just freshly installed SQL Server Express 2014 via Chocolatey. The service is currently running.
When I run this inside my CMD or Powershell:
> sqlcmd -e -S .\SQLEXPRESS
1> sp_databases;
2>
I get no output, it just goes to the next prompt line.
However when I use this style, I do get output:
> sqlcmd -e -S .\SQLEXPRESS -Q "sp_databases;"
sp_databases;
DATABASE_NAME DATABASE_SIZE REMARKS
-------------------------------------------------------------------------------------------------------------------------------- ------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
master 7808 NULL
model 5312 NULL
msdb 37632 NULL
tempdb 2560 NULL
What could be the reason for this? I have no special configuration for the CMD or Powershell except some colour changes of the console.
Upvotes: 14
Views: 4624
Reputation: 6372
Turns out I just needed to run GO
at the end of each command. Silly.
Upvotes: 24