osql unable to connect to default instance when explicitly stated

  • When connecting to the default instance using osql on the server :

    1. this works

    osql -S localhost -U sa -P password

    2. this fails

    osql -S localhost\mssqlserver -U sa -P password

    ([DBNETLIB]Sql server does not exist or access denied

    In practice I can miss out the -S setting but I wonder what I'm doing wrong as regards specifying the instance.

    Ewan

  • Ewan

    Are you saying you have two instances on the same computer: a default instance and a named instance called mssqlserver?

    John

  • Ewan,

    The default instance of SQL Server is always referred to as the server name, not server\service (localhost\mssqlserver). You can also refer to it by network name. Only named instances are referred to by servername\instancename.

    Hope this helps.

  • John

    Apologies in delay in getting back. No, I only have the 1 instance. I assumed that the syntax should be the same for the default as for other instance but this does not appear to be the case - see post from Rich.

    Thanks for response.

    Ewan

  • Rich

    Thanks for the answer.

    Ewan

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply