# Tuesday, September 01, 2009
I would like to point out the difference between (local) and localhost. Those special "addresses" are often used in connection strings.

There are common misconception that, those address are the same. This is not the case.

"... it depends on the provider you're using to connect. If you're using the SQL Server Native Client or the .NET Data Provider for .NET 2.0 the behavior is the same regardless of which name you use (localhost/(local)/or "."). These providers will first try to connect using Shared Memory, then try to connect using TCP/IP and then finally Named Pipes."

It is not advisable to use (local) for other providers, because of the ambiguity (you have 3 different ways to access the SQL server). It is better to explicitly define the connection type (typically TCP/IP), with localhost.

More info:
http://msdn.microsoft.com/en-us/library/ms187662.aspx
http://msdn.microsoft.com/en-us/library/ms191260.aspx
http://msdn.microsoft.com/en-us/library/ms189307.aspx

posted on Tuesday, September 01, 2009 5:54:42 AM (Central European Daylight Time, UTC+02:00)  #    Comments [0] Trackback
Related posts:
EXECUTE permission denied