Install Northwind database in Microsoft SQL Server 2019 Express

In many examples, you use the Northwind sample database. So you need to install it in your SQL Server instance. You can download the Northwind database scripts from its GitHub repository at https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/northwind-pubs. Specifically, the instnwnd.sql file contains scripts necessary for creating the Northwind database.

Read more : Get started with ASP.NET Core MVC 3.1

Using SQL Server Management Studio

Once you have the database script, you can run it using SQL Server Management Studio .

Step 1 : In SQL Server Management Studio, connect to an instance of the SQL Server Database Engine.

Step 2 : Open the script in a new query window

Step 3 : Run the script

Step 4 : Click the “! Execute” button

Step 5 : After a successful execution of the Query, you should find your newly populated database.

Step 6 :Adding a Countries table

The Employees table contains a Country column that stores an employee’s country. Therefore, on the data entry pages, you need to accept a country from the end user. Instead of accepting the user input in a textbox, it would be nice to display a list of countries to choose from. This requires another table, Countries, that contains a list of countries. The default installation of Northwind doesn’t contain such a table, and hence you need to add one.

The Countries table contains just two columns: CountryID and Name. The CountryID is an integer identity column, whereas Name is a varchar column with length of 80 characters.

Make sure to add a few countries in the Countries table so that you can use it in Employee Manager.

Add Comment