When I am running this from cmd on my SQL Server 2008 instance:
sqlcmd -U sa -S mymachinen_name\\MSSQLSERVER
(where MSSQLSERVER
Typically, the MSSQLSERVER
service is the service of a un-named default instance.
Therefore, try this:
sqlcmd -U sa -S mymachine_name
(without specifying any instance name - just the machine name)
I encountered this error trying to connect to the server through Jenkins and resolved it this way:
sqlcmd -e -S "SERVER_NAME,PORT_NUMBER" -U %USER% -P %PASSWORD% -i "D:\\test.sql"
It is set on installation, there is no default. Try to log on without a username