Reputation: 45771
I am using VSTS 2008 + C# + ADO.Net + SQL Server 2008. My questions about what kinds of communication protocols SQL Server 2008 will be using, more details of my questions,
If the connection string looks like this, whether Named Pipe or TCP/IP is used? Will different communication protocol being used dependent on whether client and SQL Server on the same machine?
Data Source=labtest1;Initial Catalog=CustomerDB;Trusted_Connection=true;Asynchronous
In SQL Server Configuration Manager, there are items called "SQL Server Network Configuration" and "SQL Native Client 10.0 Configuration". I find both of them has configuration options (for communication protocols) of Named Pipe or TCP/IP, what are the differences between "SQL Server Network Configuration" and "SQL Native Client 10.0 Configuration"?
Upvotes: 2
Views: 4457
Reputation: 7592
The settings configured in SQL Server Native Client Configuration are used on the computer running the client program. When configured on the computer running SQL Server, they affect only the client programs running on the server.
Microsoft SQL Server clients on a machine communicate with SQL Server servers using the protocols provided in the SQL Server Native Client library file.
Remember that these settings are not used by the Microsoft .NET SqlClient. The protocol order for .NET SqlClient is first TCP, and then named pipes, which cannot be changed.
Upvotes: 3
Reputation: 754398
According to SQL Server 2008 Books Online, this is what happens:
Connecting Locally on the Server
When you connect to the Database Engine from a local client (the client application and SQL Server are on the same computer), the connection uses shared memory protocol by default. SQL Server Native Client accepts any of the following formats to connect locally using the shared memory protocol:
To connect locally using another protocol (for troubleshooting), do one of the following with the protocol enabled:
Connecting over the Network
By default, the default protocol for SQL Server clients is TCP/IP. If the connection cannot be made using TCP/IP, the other enabled protocols are attempted. A shared memory connection cannot be made over a network. Use SQL Server Configuration Manager to enable or disable client protocols, and to change the order in which connection attempts are made.
In the Sql Server Configuration Manager, you can define an order for the client protocols - I would assume that's the order the client tries to connect to SQL Server with. Whichever protocol is the first being supported by the server will be used.
AS for the configuration utility:
If you have a dev box with both on it, you'll see both. A regular PC connecting to a SQL Server typically doesn't have SQL Server itself installed on it locally, so the server-side settings are meaningless there, obviously.
Marc
Upvotes: 6