CST2355 Lab02aIS
CST2355 Lab02aIS
Hand-in:
1. The lab assignment will be graded out of a maximum 3 points. (a maximum of 1.5 points for
the portion handed in during the lab session, and an additional 1.5 points for the portion
handed in before the due date.)
2. This template should be used to submit your lab assignment. That means you should
save a copy of these instructions and then add your screenshots and other notes to
that copy. Then submit the updated version to Brightspace. This will thoroughly
document your work and make it much easier to review before the midterm test.
3. Make sure you have enough screenshots to completely document that you have completed all
the steps.
Activities (Steps):
NOTE: Ensure that the requested screenshot is uploaded to Brightspace) BEFORE the end
of this lab session in order to NOT receive a grade of zero (0)
1. In this lab you will be using the Microsoft SQL Server 2019 database management system, and
the MS SQL Server Management Studio (Version 19). The first step is to get the software
installed.
1.1. Follow the instructions below to install MS SQL Server 2022 (Developer Edition) and the
SQL Server Management Studio 19
1.1.2. NOTE: Make sure you take a screenshot of the confirmation screen that shows all the
configuration folders, when you download and install the Developer edition – Basic Install.
(Use the “Basic” installation configuration).
2. On the confirmation screen, select “Install SSMS” to install the SQL Server Management Studio.
2.1. You need to download Version 19 or later and then run the setup file.
3.1. The first time you open the tool, save the launch screen – it shows your instance name. Here
is an example:
3.2. Paste your screen here – it is useful because it shows the server name:
4. We are going to import our “Departments” and “Employees” tables from Microsoft Access (lab 1).
The simplest way to do this without any glitches from version mismatches and missing adapters is
to export the data from Microsoft Access into separate Microsoft Excel or .csv (comma-
separated-value) text files and then import those files into SQL Server: as follows;
4.1. Open your lab 1 version of the Northwind database that contains the “Departments” table and
your updated “Employees” table.
4.2. Select the “Departments” table and then right mouse click and select the “Export ->Text File”
option from the Develop Menu. (See below)
4.4. DO NOT select the export data with formatting and layout. Then when you click OK you will
get prompted for delimiter options….
it
4.5. Select the ‘Delimited’ option and click Next. You will then get prompted as follows….
4.6. Make sure you DO select the “Include Field Names in First Row” option, and then Click Next.
4.7. Continue the exporting process for the “Departments” table and repeat the process in a similar
fashion for the “Employees” table.
5. Continue by using SSMS (or re-open it if you have closed it and connect to your server).
5.1. Once launched, select “Databases” and create a new one (right-mouse click, etc.) named
“lab2”.
5.2. Select the lab2 database and then use the right-click menu to select the Tasks > Import Flat
File option. You want to import the “Departments” text file. The sequence is straightforward
(try it) BUT make sure you select the “DepartmentsID” field as the primary key when prompted
(see below).
5.3. Once the Departments table is successfully imported, repeat the process in a similar fashion
for the “Employees” table. You should now be able to see your imported tables inside the
lab2 database.
5.4. Now you can use SSMS to build a New query to verify that the data was imported correctly:
5.5. and execute it to show all the data in the imported table. Here is an example:
Paste your screen shot here displaying your name in the Employee table:
THIS IS THE SCREENSHOT THAT YOU MUST UPLOAD TO BRIGHTSPACE DURING THIS
LAB SESSION – PLEASE DO SO NOW!
LABEL THE FILE AS LAB#-IS – E.G.: LAB1IS, LAB2AIS, LAB2BIS, LAB3AIS, ETC. (IS =
INITIAL SCREENSHOT)
6. We want to allow remote applications (not just local SSMS) to connect using a
username/password without relying on Windows authentication. This will allow MS-Access and
other applications running on a client workstation to access the remote data.
6.2. In the properties dialog, select the Security page and then the option for “SQL Server and
Windows Authentication Mode”.
6.3. On the Connections page, select the “Allow Remote Connections to this server” option.
6.4. After you have made these changes, you will need to restart the server.
6.5. One last thing on the server side – we need to create a new user account for our applications
to use when they connect. Use yourlastnameuser (e.g., royuser) with a simple password
(e.g., royPassword123) and perform the following steps:
6.5.2. In the dialog for New login, select the General page and fill in the following fields. This
step needs to be done carefully – make sure you set the default database and unselect
the password expiry fields…. Otherwise you will not be able to connect easily from
applications.
6.6. If successful, you will see your new login in the list…
6.7. Now, while still connected as the Windows login user, (e.g., royd) run the following sql
commands to change the ownership of the database lab2. (you will need to change the login
name to yourlastnameuser).
USE lab2;
EXEC sp_changedbowner 'royuser', 'true';
7. Now open a new connection to the (restarted) server and connect using your new login and
password. You should be able to see your data in the lab2 database.
7.1. Provide a screenshot for a query showing the content of each of the tables. Make sure
the screenshots clearly show your connection login, the queries being executed, and
the results.
8. Once you have embedded all of your screenshots, I would encourage you to show the result to
your lab professor – if you are done in the lab session. Make sure you have included all of your
screen shots to document your work and submit the file in Brightspace and you’re done!