0

I have MS SQL Server 2014 Management Studio installed on two computers, both of which run on Windows 10. The switches for SQLCMD command are case-sensitive on one computer, but it is not on the other one. If I type the command with lower case switches (like the below examples), it works on one but doesn't work on the other.

sqlcmd -s .\<_servername_>
sqlcmd -l 

For the second computer, I have to type with upper case as shown below.

sqlcmd -S .\<servername>
sqlcmd -L

What is the issue/setting that decides this?

3

Yes, SQLCMD switches are case sensitive.

 -l login_timeout  
 -L[c] (list servers, optional clean output)  
 -s col_separator  
 -S [protocol:]server[instance_name][,port]

When you connect using

sqlcmd -s .\<servername>

is connects to the default instance and uses ".\<servername>" as column separator

While on the second machine there may not be any default instances so you need to enter -S .\ explicitly to connect to a named instance

  • 2
    Please combine your two answers into one using the edit function. There's no need to split them in this case. Thank you. – Andriy M Jun 1 at 10:04
0

When you connect using

sqlcmd -s .\<servername>

is connects to the default instance and uses ".\<servername>" as column separator

While on the second machine there may not be any default instances so you need to enter -S .\ explicitly to connect to a named instance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.