LocalDb – SQL Express for Developers


When you install Visual Studio 2012 or higher the Sql Server Express component is also installed on your machine. When you add a connection to a database within VS I normally use .\SQLEXPRESS as the server name.


The .\SQLEXPRESS server name is totally fine and it will work. But I noticed that, like when you create a new ASP.Net MVC project, the default connection to the database is pointing to a LocalDb. I do not remember installing any LocalDb server.

New Asp.Net MVC Project

LocalDB Config

Nothing in my local machine services is running as LocalDb.

SQL Express Service

What is LocalDb vs Sql Server Express?

Based on this blog from MSDN SQL Server team, SQL Server Express is still a free version of the SQL Server. However, they decided to release LocalDb as a SQL Express edition for developers that will continue to be small, low footprint and easily configurable with no admin access required.


One advantage I can see from using LocalDb is that you can still attach a file database using AttachDbFileName even if the connection is living within the same instance of the sqlservr.exe.

AttachDbFileName feature is a plus for developers who can request for a sample data in a file and use it to attach to the LocalDb just like you are connected to a full version of SQL Server.

As a personal note to myself, I should blog a lot more so expect more blog posts to come from me 🙂