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 › microsoft › sql-server-samples › tree › master › samples › databases › northwind-pubs
sql-server-samples/samples/databases/northwind-pubs at master · microsoft/sql-server-samples
This folder contains scripts to create and load the Northwind (instnwnd.sql) and pubs (instpubs.sql) sample databases. These scripts were originally created for SQL Server 2000.
Author   microsoft
Discussions

How can I install the Northwind database into SQL Server Local DB? - Stack Overflow
I found the following link Installing the Northwind Sample Database However I am still not clear on the process. This talks about Server 2000 and MSDE 2000 but what I need is for the new SQL Ser... More on stackoverflow.com
🌐 stackoverflow.com
I Need the Northwind Database on SQL Server
Find answers to I Need the Northwind Database on SQL Server from the expert community at Experts Exchange More on experts-exchange.com
🌐 experts-exchange.com
June 23, 2023
Hi SQLServer guys! Need a database sample like Northwind, but better.

Use the Stack Overflow database. It's licensed with Creative Commons, it's got an easy-to-understand schema, it's got fun real life data, and it's sizable so you can get more interesting query plans. Here's how to download and import it: http://www.brentozar.com/archive/2014/01/how-to-query-the-stackexchange-databases/

More on reddit.com
🌐 r/SQLServer
5
3
June 27, 2015
Northwind Database for SQL Server 2005 – SQLServerCentral Forums
Northwind Database for SQL Server 2005 Forum – Learn more on SQLServerCentral More on sqlservercentral.com
🌐 sqlservercentral.com
September 18, 2012
🌐
Wikiversity
en.wikiversity.org › wiki › Database_Examples › Northwind › SQL_Server
Database Examples/Northwind/SQL Server - Wikiversity
-- Either: -- Open Microsoft SQL Server Management Studio. -- Connect to your server. -- Open a new query window. -- Copy and paste the SQL below into the query window. -- Execute the script to create the Northwind database. -- Or: -- Run the following command in a terminal window.
🌐
Alpha Software
documentation.alphasoftware.com › documentation › pages › GettingStarted › GettingStartedTutorials › Basic Tutorials › Northwind › northwindSQLServer.xml
Importing the Northwind Access Database into SQL Server
Right-click on the northwind database in the Object Explorer and select Tasks then Import Data.... Click Next to start the SQL Server Import and Export Wizard.
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.
🌐
Experts Exchange
experts-exchange.com › questions › 29261557 › I-Need-the-Northwind-Database-on-SQL-Server.html
Solved: I Need the Northwind Database on SQL Server | Experts Exchange
June 23, 2023 - I have SSMS and need to add Northwind to my local SQL Server instance. ... This does not seem easy to me... I just want the file db file so I can add it, using SSMS. ... We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads. ... Here is the script which will do the work for you: https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/northwind-pubs and here are the steps: https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/downloading-sample-databases
Find elsewhere
🌐
YugabyteDB
docs.yugabyte.com › stable › develop › sample-data › northwind
Northwind sample database | YugabyteDB Docs
May 7, 2026 - The Northwind sample database includes 14 tables and the table relationships are showcased in the following entity relationship diagram. The Northwind SQL scripts reside in the share folder of your YugabyteDB or client shell installation. They can also be found in the sample directory of the YugabyteDB GitHub repository.
🌐
Medium
medium.com › @mythilyrm › the-northwind-database-f2fa1f59daa7
The Northwind database
April 22, 2023 - I`m going to work with Microsoft’s sample database for SQL Server named Northwind. It describes a fictional store and its customers, suppliers, and orders. You can find the original database in Microsoft’s GitHub repository.
🌐
SQLServerCentral
sqlservercentral.com › home › topics › northwind database for sql server 2005
Northwind Database for SQL Server 2005 – SQLServerCentral Forums
September 18, 2012 - I printed "Northwind Database Installation" and "Installing the Northwind Sample Database", both from Microsoft webpages. I just noticed that the latter is for VS 2012 and I need to go back and click on "Other Versions" to get specific instructions on how to install to SQL Server 2005 Developer Edition.
🌐
GitHub
github.com › yugabyte › yugabyte-db › wiki › Northwind-Sample-Database
Northwind Sample Database
July 22, 2019 - You can download the Northwind database that is compatible with YugaByte DB from our GitHub repo. Here’s the two files you’ll need: northwind_ddl.sql which creates tables and other database objects
Author   yugabyte
🌐
GitHub
raw.githubusercontent.com › microsoft › sql-server-samples › master › samples › databases › northwind-pubs › instnwnd.sql
Northwind database - GitHub
-- 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 strings are interpreted correctly regardless of the default DATEFORMAT on the server.
🌐
Wikiversity
en.wikiversity.org › wiki › Database_Examples › Northwind
Database Examples/Northwind - Wikiversity
March 21, 2025 - GitHub: Northwind and pubs sample databases for Microsoft SQL Server · Google Code: Northwind Downloads - MySQL, Oracle, Postgres, SQLite, SQL Server, VistaDB, XML · ↑ Wikipedia: Northwind · ↑ CodePlex: Northwind License · Retrieved from "https://en.wikiversity.org/w/index.php?title=Database_Examples/Northwind&oldid=2707978" Category: Databases ·
🌐
SQLServerCentral
sqlservercentral.com › home › articles › sql server sample databases
SQL Server Sample Databases – SQLServerCentral
June 27, 2022 - These databases used to be included in the SQL Server 2000 installer. Now, you can find it on GitHub at the following URL: https://github.com/microsoft/sql-server-samples/tree/master/samples/databases/northwind-pubs
Top answer
1 of 2
10

See https://github.com/jpwhite3/northwind-SQLite3

"All the TABLES and VIEWS from the MSSQL-2000 version have been converted to Sqlite3 and included here. Also included are two versions prepopulated with data - a small version and a large version"

2 of 2
3

You can download a version of sqlite3 database from

https://code.google.com/archive/p/northwindextended/downloads

Advantage: It is available immediately. Click and use.

If it's simply to get a sample database for general testing, then just use what's immediately available. If you require an exact copy to match testing results (for instance), then download and convert MS data yourself to ensure exactness since the file's header indicates modifications and added foreign keys and contains no other certification of content. You really need to answer this for yourself based on your own requirements.

Without knowing anything about the conversion process, I would at least guess that the date values are not precisely the same since sqlite has no native DateTime type, rather such values would have needed to be converted to string values and/or Julian numeric values. Of course the values themselves may represent the same dates and times, but processing of query data would certainly require special handling. BLOB values for images should also produce the same images, but retrieving and using those values will likely be different than getting them from other databases. I suppose there could be other data values/types that different handling would apply since sqlite really has no distinct, strict numeric types, rather just type affinities.

🌐
InformIT
informit.com › articles › article.aspx
The SQL Server Sample Databases: NorthWind | SQL Server Reference Guide | InformIT
Starting in SQL Server 2008, Microsoft is no longer including the sample databases on the SQL Server installation media. You have to download them from the “Codeplex” site. In fact, you can get most all of the sample databases there. I’ll include a link to all of that at the end of this article. The Northwind database was Microsoft’s first attempt at making a unified set of objects available for cross-platform examples.
🌐
Appworks-tips
appworks-tips.com › 2021 › 06 › 25 › 100_how_to_use_the_northwind_database_example_data
How to use the 'Northwind' database example data | OpenText™ Process Automation Tips
June 25, 2021 - The Northwind database is a sample database used by Microsoft to demonstrate the features of some of its products, including SQL Server.
🌐
W3Schools
w3schools.com › sql › sql_syntax.asp
SQL Syntax
In this tutorial we will use the well-known Northwind sample database (included in MS Access and MS SQL Server).
🌐
SQLTeam
forums.sqlteam.com › other sql server topics
Northwind database queries - Other SQL Server Topics - SQLTeam.com Forums
August 15, 2023 - hi pls i need urgent support to complete my sql assignment i need queries for northwind database Write a script to output a unique list of customers across customers and suppliers tables. Display Customername, Contact…