Import Northwind Sample
How can I install the Northwind database into SQL Server Local DB? - Stack Overflow
Origin of "Northwind" Database
Northwind database and Normal forms question/help
So I've been attempting to learn SQL using mysql instead of sqlite but using the slqalchemy libraries. I'm currently doing everything in Geany because that's the text editor I decided to use.
But now I'm having trouble trying to figure out how to import the northwind database.
Can anyone help?
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.
How about just restoring via SSMS using Steps:
- Download northwind (https://northwinddatabase.codeplex.com/) and save .bak somewhere
- Open SSMS
- Connect to (localdb)\ProjectsV12 (or whatever version you have)
- Right Click Databases Node (see image)
- Select Restore...

- 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

- That's it, your .bak should be loaded to a new database on your machine.