Systems Engineering and RDBMS

Archive for August 12th, 2007

Sample User databases for SQL Server

Posted by decipherinfosys on August 12, 2007

One of the recent questions that we got was: “Where can I get the Northwind and the Pubs database scripts or back-ups? I want to use those with SQL Server 2005 since the Entity Framework code refers to those.” As you know, in SQL Server 2005, the AdventureWorks and AdventureWorksDS user databases are included instead of the Northwind and the Pubs databases. And those 2 databases are also not installed by default due to security reasons.

You can download the AdventureWorks and the AdventureWorksDS databases from here. The reason for changing the sample databases was to take into account the new feature sets of Reporting Services and Analysis Services. MSDN and SQL Server BOL in the 2005 version also has all the sample code against these new user databases so we would advise using them and becoming familiar with the data model for these databases.

However, since most of the Entity Framework code as well as many other code samples at codeplex still refers to the Northwind database, you can download those from here. The instructions for extraction of the files are also given on that download page.

Once you have the files (SQL script files as well as the mdf and the ldf files), you can then use the Management Studio to run the SQL script files or use osql (this is going to be deprecated in the future) or use SQLCMD to run the scritps and create the databases. Alternatively, you can also choose to simply attach the mdf and ldf files in order to create those databases on your instance. That can be done either through the GUI or command line using sp_attach_db.

Posted in SQL Server | Leave a Comment »