A blog by Jose Barreto, a member of the File Server team at Microsoft.
All messages posted to this blog are provided "AS IS" with no warranties, and confer no rights.
Information on unreleased products are subject to change without notice.
Dates related to unreleased products are estimates and are subject to change without notice.
The content of this site are personal opinions and might not represent the Microsoft Corporation view.
The information contained in this blog represents my view on the issues discussed as of the date of publication.
You should not consider older, out-of-date posts to reflect my current thoughts and opinions.
© Copyright 2004-2012 by Jose Barreto. All rights reserved.
Follow @josebarreto on Twitter for updates on new blog posts.
Q) In connectionstrings I often see server=localhost. Where is this "localhost" name coming from? Is it in a file somewhere? Is it true that the server must be using TCP/IP for this to work? I also see server=. and server=(local) in connection strings. Do they work the same way and is there a different protocol being used or another setting?
Localhost is a name defined on every computer running TCP/IP and it maps to 127.0.0.1.This is actually stored in the C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS file. You do have to be using TCP/IP for localhost to be available.
You can get details at: http://www.microsoft.com/technet/itsolutions/network/evaluate/technol/tcpipfund/tcpipfund_ch07.mspx
"." and "(local)" are not in TCP/IP. Those are implemented in the connection string parser of the SQL Server client. Starting in ADO.NET 2.0, you can also specify the protocol using "tcp:(local)", "np:(local)" or "lpc:(local)".
You can get details at: http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx