I’m trying to connect to a named SQL instance on the server.
There is already default instance of SQL Server 2005 and a newly named one – SQL Server 2008. I’m using the “Network library” property to use TCP connection but for some reason, he try’s to connect the default instance and omit an error about login error.
If I remove the network library propery the connection established as well without any error.
I’m using windows authntication and have all the permissions needed.
The problematic connection string:
Data Source=ServerName\InstanceName,1433;network library=dbmssocn;Initial Catalog=MyDataBaseName;Integrated security=SSPI
The working connection string:
Data Source=ServerName\InstanceName;Initial Catalog=MyDataBaseName;Integrated security=SSPI
Omitting the ,1433;network library=dbmssocn from the connection string makes the difference. adding it maked the server to connect the deafult instance.
Both of the server allows remote connections.
I would like to understand why, please.
Thanks in advance,
Tamir
Copied from my answer on your question on ServerFault…
The connection strings have 2 differences so I’ll try to answer for this…
So:
ServerName\InstanceName,1433means connect to server “ServerName” on port 1433ServerName\InstanceNamemeans connect to server “ServerName” and resolve instance name to correct port (resolve uses port 1434 UDP)However,
network library=dbmssocnmeans use tcp. It could be the SQL Server instance (see port stuff) does not listen on tcp