You can also view and manage databases in the Visual Studio integrated development environment (IDE). In Visual Studio, connect to the database from SQL Server Object Explorer, or create a Data Connection to the database in Server Explorer. Open these explorer panes from the View menu.
The Northwind and Pubs sample databases are staples of other sample code on this and other development websites. They are used in countless tutorials and walkthroughs published by Microsoft and others. Being a SQL/SQL Server newbie myself, I figured there may be others in my boat who might want both databases in an easily-accessible spot, and an easier, less error-prone way of installing them into SQL Server 2005 Express Edition than, say, running SQL query scripts.
I wrote this back in 2005, when I myself was just starting out with SQL Server. I was searching the documentation and came upon samples making use of the Northwind and the Pubs databases. However, I was unable to find anything in MSDN that actually walked one through installing them in SQL Server Management Studio. Therefore, back then I wrote this article, so as to help other SQL Server beginners.
This is NOT a copy & paste article. I am an experienced technical writer, and an astrophysicist. Perhaps it may be the case that Microsoft has already posted new documentation on installing databases into SQL Server Management Studio graphically; however, at the time this article was originally posted back in 2005, at the time I had been unable to locate an equivalent article in the Microsoft documentation; hence, I wrote my own, which has evolved into this article.
It's lost on me why one must use *.sql query scripts to install these samples. It's also lost on me why SQL Server distributions don't come with these databases provided, since they are used so ubiquitously through documentation, websites, and tutorials. There are probably several good reasons for this. However, I am focused on usability, and not on making things harder than they have to be.
It's worth noting, for example, that a default Visual Studio .NET 2005 Standard Edition installation does not distribute these databases. It goes part-way, creating a Program Files\Microsoft Visual Studio 8\SDK\Samples\Setup directory containing, e.g., instnwnd.sql, a query script that ostensibly can be used to install the Northwind sample database.
However, hats off to Microsoft for putting apples with apples. Microsoft provides the queries for installing, but not the *.mdf and *.ldf files for the databases themselves. This does not support users in installing these important samples into SQL Server. Perhaps there's an easier way: this article. The download attached to this article contains the SQL Server 2000 versions of these files.
The Northwind and Pubs sample databases are staples of other sample code on this and other development websites. They are used in countless tutorials and walkthroughs published by Microsoft and others. Being a SQL/SQL Server newbie myself, I figured there may be others in my boat who might want both databases in an easily-accessible spot, and an easier, less error-prone way of installing them into SQL Server 2008 Express Edition than, say, running SQL query scripts.
SQL Server beginners and database development beginners are the audience for whom this article is written.
I wrote this back in 2007, when I myself was just starting out with SQL Server. I was searching the documentation and came upon samples making use of the Northwind and the Pubs databases. However, I was unable to find anything in MSDN that actually walked one through installing them in SQL Server Management Studio. Therefore, back then I wrote this article, so as to help other SQL Server beginners.
This is NOT a copy & paste article. I am an experienced technical writer, and an astrophysicist. Perhaps it may be the case that Microsoft has already posted new documentation on installing databases into SQL Server Management Studio graphically; however, at the time this article was originally posted back in 2005, at the time I had been unable to locate an equivalent article in the Microsoft documentation; hence, I wrote my own, which has evolved into this article.
So, enjoy this article, for what it's worth.
There undoubtedly will be readers who will protest and say that I should use *.sql query files whenever possible; this is good and a perfectly acceptable practice. For example, if you have complex queries or you need to attach several databases in a batch, then *.sql query files can be very useful. I see this article as illustrating just another way to accomplish a similar objective.
It's worth noting, for example, that a default Visual Studio .NET 2008 Professional Edition installation does not distribute these databases. Unlike the previous version of Visual Studio .NET, it does not even go part-way by installing the required SQL Scripts --- at least, I have not been able to locate them with the latest version. The download attached to this article contains the latest version of the Northwind and Pubs database files as distributed by Microsoft on MSDN.
Personally, I favor using graphical (GUI) tools and methods over typing cryptic commands and deciphering error messages. So, this article illustrates how to install the Northwind and Pubs databases using graphical tools and methods.
I just yesterday managed to make a connection to the SQL Server with some very fine assistance by a few MS MVP's (In another Forum) but the ADO.NET 2.0, Microsoft Press, author Rebecca M. Riordan uses the Northwind and the Pubs databases in the exercises throughout the book so I need to add these two databases to the Server so that I can continue my study of this very fine text. I have the Northwind Database in my Microsoft Access but I do not want to try to create such a hugh database in the SQL Server on my own. I have created two of the Tables to the Pubs DB and it was quite a bit of work and subject to my errors. MS furnishes text so that I can build these two databases in my SQL Server but that is a hugh task for this newbie. Any suggestions on how or where I can download the databases and add them to the Server? Thank you and have a good day. JRichards54 ?
Yes, I certainly have had more success installing the Northwind and pubs databases. I ran the SQL Script files (.sql) from my VS 2005 Query Editor and when I clicked on "Execute" there it was. I then ran it again for the other one and both are now in my Server along with the Adventureworks and the System Databases (which I do not mess with).
As a beginner in C#/VS I want to practice making basic LINQ queries on simple DB's. I downloaded the "famous" Northwind and Pubs databases on the official Microsoft websites ( -us/download/details.aspx?id=23654). It gave me a .msi files that installed 6 files on my c: instnwnd.sql, instpubs.sql, NORTHWND.LDF, NORTHWND.MDF, PUBS.MDF, PUBS_LOG.LDF.
You need to attach the databases before you can see them**. You're having a problem attaching the databases due to versioning (which is odd), but your sample db's are very old. Perhaps try newer ones from here and make sure you attach them before expecting them to show up in the tools.
** Technically this is not true. I believe there is a way of connecting to sql server and passing a file path in the connection string, however this will likely still fail for your due to the error you get trying to attach the dbs you have. Additionally, it requires a specially crafted connection string which may or may not be usable with the gui tools you're trying to use. It is also, in my opinion, a less common way of accessing sql server databases, so I would stick with attaching them first. If you want to find out more about this, I believe the feature you need to research is called 'sql server user instances'.
Last week I was working on a SQL Server presentation, to explain the basic of databases and how SQL Server works to a few colleagues. At the end of my presentation, I wanted to show some demo queries. Normally I would create my own tables with sample data, but I want to give them the opportunity to repeat the demos again on their own.
For many years Microsoft has shipped example databases with its database products, SQL Server and MS Access. In this article I have listed five that are useful in training and testing. Also included are download links and some practical installation information.
The earliest example database from Microsoft was Pubs, which according to this article came from SYBASE and has been around since the nineties. Northwind came later as an example database for Microsoft Access and was later ported to SQL 2000. Pubs is a book vendor and Northwind Traders is an import/export company.They are both old and rather simplistic compared to modern databases. That being said, they are still useful for learning database fundamentals partially due to that simplicity.
To use either of these databases in later versions of SQL Server we need to execute the query script. You can do this in Visual Studio, but I prefer using SQL Server Management Studio.
1. Login to MS SQL Server Management Studio and from the main menu go to File > Open > File. Browse to the SQL Server 2000 Sample Databases folder that was created from the downloaded installation file, click on either instpubs.sql or instnwnd.sql, and click Open.
dd2b598166