Connectivity to SQL server fails when "Network Library = dbmssocn" is used in addtion to having a TCP alias

I recently came across this interesting issue : The end customer was trying to connect to SQL server named instance from a Remote client machine via a application. The Server instance that he was connecting to already had a TCP alias on the client machine. In the connection string he was specifying “Network Library = dbmssocn“. The application was failing in it’s attempt when trying to connect to SQL server with the following error message :

Test connection failed because of an error in initializing provider. [DBNETLIB][ConnectionOpen (Connect()).]Specified SQL server not found.

When we collected the Network Monitor trace , we found that client was attempting to connect to SQL server on the UDP port 1434 rather than the TCP port 1433. While further probing into the issue , as soon as we removed the “Network Library = dbmssocn” from the application’s connection string the application was able to connect to SQL server successfully.

To conclude on this issue , we found out that there was no requirement for the developers to specify the network library in the connection explicitly when they already had a TCP alias created for the SQL Server.

Comments (3)

  1. Peter says:

    I meet your problem, do you know to config the SQLServer to make it work?

  2. Karthik says:

    Please let me know the connection string used for SQL Server alias through TCP/IP…

  3. LeslieCauston says:

    Or leave the tcp: off the front of the Serverinstance name.

    So, this will work:

    Network Library=dbmssocn;Data Source=BP1XGBDB307SIVFUNOAT40

    So will this:

    Data Source=tcp:BP1XGBDB307SIVFUNOAT40

    But despite the Microsoft documentation, this will NOT work

    Network Library=dbmssocn;Data Source=tcp:BP1XGBDB307SIVFUNOAT40


    tcp:<host name><instance name>

    The TCP format must start with the prefix "tcp:" and is followed by the database instance, as specified by a host name and an instance name.…/