SQLCMD – Cannot Connect to Named Instance

sql serversqlcmd

I am using SQL Server 2017 based on Windows server 2016. I am trying to connect my named instance, but I got the error message as below screenshot:
Can not connect to SQL instance by SQLCMD

So I tried to reinstall ODBC Driver 13. But I got the error as follow:
reinstall ODBC Driver 13

Even after I uninstalled ODBC Driver 17, I still got the same error message.
Any thought?

Thanks in advanced!

Best Answer

You must specify the server name with -S (capital letter) instead of -s (lowercase).

From the documentation:

   -s col_separator  
   -S [protocol:]server[instance_name][,port]