-S unknown parameter when using sqlcmd

I get an error when executing the below command from a DOS window in Windows XP with SQL Server 2008. -S is the ability to specify the server name.

error: Sqlcmd: '-S': unknown parameter.

sqlcmd -S localhost -d databasename -i C: \ files \ somefile.sql -E

+3
source share
3 answers

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.

+4
source

Is localhost the right link to use? Try sqlcmd -L to get a list of servers.

0

LocalHost IIS

(LOCAL) SQL Server.

0

Source: https://habr.com/ru/post/1719459/


All Articles