Now it works using. as the server name when I typed the line manually. What I did earlier is to enter the command in the editor, copy it and paste it into the command line. I guess the invisible control character got there while copying. I opened another dos window and typed a similar command using "localhost" and it worked. I never used sqlcmd to connect to the server, so I thought my syntax was incorrect.
localhost ,. and (local) should work, and if you use a non-existent server name, it will complain that it cannot connect. It should not indicate -S is not an option.
source
share