So, I can't seem to find a way of attaching an existing DB file to a LocalDB instance from inside visual studio (creating a new DB seems to be the only option), but you can do it via management studio by doing the following:

Step 1 - Find out the instance name of the LocalDB

Open a command prompt and run (the location may be slightly different depending on your install location):

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>SqlLocalDB.exe info

This will list all the instances of LocalDB, find the one you're interested in, VS2012 installed one for me called v11.0 (which I will use for my example)

Step 2 - Start the LocalDB instance

Again in your command prompt run the following:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>SqlLocalDB.exe start v11.0

This will start the LocalDB instance and allow us to get the connection info

Step 3 - Get the name of the named pipe to connect to (pipe name changes every restart)

Another command prompt job:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>SqlLocalDB.exe info v11.0

This will then return information about the instance, including the following line:

Instance pipe name: np:\.\pipe\LOCALDB#A6F550C6\tsql\query

Step 4 - Connect via management studio and attach the database

Open management studio and in the server box connect to the named pipe (windows auth) e.g. :

\.\pipe\LOCALDB#A6F550C6\tsql\query

You will now be in the SQL server like it was a normal instance, you can copy your Northwind MDF file to the data directory of the instance (mine was the root of my user folder) and then in the databases node in the management studio right click and select attach, select the MDF file and then attach as normal.

Hope this helps.

Answer from steoleary on Stack Overflow
🌐
GitHub
github.com › CrusadorBoz › Northwind
GitHub - CrusadorBoz/Northwind: Backup of Northwind database SQL Server · GitHub
Backup of Northwind database SQL Server. Contribute to CrusadorBoz/Northwind development by creating an account on GitHub.
Author   CrusadorBoz
🌐
FoxLearn
foxlearn.com › home › sql › how to download and restore northwind database to sql server
How to Download and Restore Northwind database to SQL Server
February 28, 2025 - To download the Northwind backup database file you can use the northwind download database .bak link below.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › framework › data › adonet › sql › linq › downloading-sample-databases
Get the sample SQL Server databases for ADO.NET code samples - ADO.NET | Microsoft Learn
Access downloads the Northwind database and prepares the file. When this process is complete, the database opens with a Welcome screen. Download the AdventureWorks sample database for SQL Server from the following GitHub repository: ... After you download one of the database backup (*.bak) files, restore the backup to an instance of SQL Server by using SQL Server Management Studio (SSMS).
🌐
GitHub
github.com › Govern24 › Northwind
GitHub - Govern24/Northwind: The Northwind database. · GitHub
This repository contains a backup of SQL Server Northwind database, including instructions for restoration. Download the database bak file Northwind.bak.
Author   Govern24
Top answer
1 of 2
12

So, I can't seem to find a way of attaching an existing DB file to a LocalDB instance from inside visual studio (creating a new DB seems to be the only option), but you can do it via management studio by doing the following:

Step 1 - Find out the instance name of the LocalDB

Open a command prompt and run (the location may be slightly different depending on your install location):

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>SqlLocalDB.exe info

This will list all the instances of LocalDB, find the one you're interested in, VS2012 installed one for me called v11.0 (which I will use for my example)

Step 2 - Start the LocalDB instance

Again in your command prompt run the following:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>SqlLocalDB.exe start v11.0

This will start the LocalDB instance and allow us to get the connection info

Step 3 - Get the name of the named pipe to connect to (pipe name changes every restart)

Another command prompt job:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn>SqlLocalDB.exe info v11.0

This will then return information about the instance, including the following line:

Instance pipe name: np:\.\pipe\LOCALDB#A6F550C6\tsql\query

Step 4 - Connect via management studio and attach the database

Open management studio and in the server box connect to the named pipe (windows auth) e.g. :

\.\pipe\LOCALDB#A6F550C6\tsql\query

You will now be in the SQL server like it was a normal instance, you can copy your Northwind MDF file to the data directory of the instance (mine was the root of my user folder) and then in the databases node in the management studio right click and select attach, select the MDF file and then attach as normal.

Hope this helps.

2 of 2
1

How about just restoring via SSMS using Steps:

  1. Download northwind (https://northwinddatabase.codeplex.com/) and save .bak somewhere
  2. Open SSMS
  3. Connect to (localdb)\ProjectsV12 (or whatever version you have)
  4. Right Click Databases Node (see image)
  5. Select Restore...

  1. In Restore Database window, Source | choose 'Device' radio button and in drop down 'Backup media Type' choose File and then click 'Add' button browse to location of downloaded .bak file

  1. That's it, your .bak should be loaded to a new database on your machine.
Find elsewhere
🌐
Mikesaysmeh
mikesaysmeh.com › a-northwind-bak-file-for-you
A northwind bak file for you | Mike Says Meh
November 28, 2012 - Here is a bak file for the northwind database taken from SQL 2012. Northwind is great for playing around with since it already has data. AdventureWorks is another. I like to have them both on test servers. Anywho, if you want a very simple method of getting northwind onto your SQL 2012 server then just download ...
🌐
YouTube
youtube.com › watch
SQL Server - How to Download and Restore the Northwind database | FoxLearn - YouTube
Download and Restore the Northwind database to SQL Server 2012/2014/2016/2017/2019. You can use the Northwind database to play the demoWebsite: https://foxle...
Published   September 25, 2018
🌐
YouTube
youtube.com › watch
Install Restore Northwind SQL Server Sample Database - YouTube
Install | Restore Northwind SQL Server Sample DatabaseLink to download Northwind database.https://parallelcodes.com/download-sql-northwind-database-bak-file#...
Published   July 22, 2023
🌐
ASPSnippets
aspsnippets.com › Articles › SQL-Server-2019-Download-and-Install-Northwind-Database.aspx
SQL Server 2019: Download and Install Northwind Database
In order to download the Microsoft’s free sample Northwind database, you will need to visit the following URL. ... Setup file (.MSI) will be downloaded.
Published   July 28, 2025
🌐
Petri
petri.com › home › sql server › sql server essentials: sql server sample databases
SQL Server Essentials: SQL Server Sample Databases | Petri
July 29, 2025 - Microsoft later removed the Northwind database with the release of SQL Server 2005. However, SQL Server users can still download them from Northwind and pubs Sample Databases for SQL Server 2000. The download is a .msi installation file called SQL2000SampleDb.msi.
🌐
GitHub
raw.githubusercontent.com › microsoft › sql-server-samples › master › samples › databases › northwind-pubs › instnwnd.sql
Northwind database - GitHub
/* ** Copyright Microsoft, Inc. 1994 - 2000 ** All Rights Reserved. */ -- This script does not create a database. -- Run this script in the database you want the objects to be created. -- Default schema is dbo. SET NOCOUNT ON GO set quoted_identifier on GO /* Set DATEFORMAT so that the date ...
🌐
SQLServerCentral
sqlservercentral.com › home › articles › sql server sample databases
SQL Server Sample Databases – SQLServerCentral
June 27, 2022 - We have the Instwnd.sql file which is the northwind installer. The instpubs.sql will install the pub's database. First, click on the file and press download.
🌐
YugabyteDB
docs.yugabyte.com › stable › sample-data › northwind
https://docs.yugabyte.com/stable/develop/sample-data/northwind/
YugabyteDB documentation is the best source to learn the most in-depth information about the YugabyteDB database, YugabyteDB Aeon, and YugabyteDB Anywhere.
🌐
supernalje
supernalje379.weebly.com › download-northwindmdb-sample-database.html
Download Northwind.mdb Sample Database - supernalje
You can download it as an.mdf file from the. There are regular and lightweight (LT) versions of the database available here. For most scenarios, the LT version is preferred because it is less complex. Northwind is a relatively simple SQL Server database that has been used for many years. You can download it as a.bak ...
🌐
GitHub
github.com › ErcinDedeoglu › northwind
GitHub - ErcinDedeoglu/northwind: Northwind database that can be downloaded as an executable sql script or as a backup that can be restored with sample data currently works with Sql Server 2005 and Sql Server 2008 · GitHub
Northwind.bak.zip - Northwind database backup for Sql Server 2005 and 2008. Unzip / decompress the file then use the Restore Database option from Sql Server Management Studio 2005 / 2008 to restore the database
Author   ErcinDedeoglu
🌐
GitHub
github.com › jonmullins › SQL_Queries › blob › master › Northwind2016.bak
SQL_Queries/Northwind2016.bak at master · jonmullins/SQL_Queries
57 Beginner, Intermediate and Advanced Queries from " SQL Practice Problems" - SQL_Queries/Northwind2016.bak at master · jonmullins/SQL_Queries
Author   jonmullins
🌐
CodeProject
codeproject.com › articles › HowTo-Install-the-Northwind-and-Pubs-Sample-Databa
HowTo: Install the Northwind and Pubs Sample Databases - CodeProject
To save you from hunting through the docs and locating downloads, we gather both databases here and walk you through installing them using SQL Server Management
🌐
Kaggle
kaggle.com › datasets › cleveranjosqlik › csv-northwind-database
CSV Northwind Database
Checking your browser before accessing www.kaggle.com · Click here if you are not automatically redirected after 5 seconds