MCT USE ONLY.
STUDENT USE PROHIBITED
L1-1
Module 1: Introduction to Microsoft SQL Server
Lab: Working with SQL Server Tools
Exercise 1: Working with SQL Server Management Studio
Task 1: Open Microsoft SQL Server Management Studio
1. Ensure that the MT17B-WS2016-NAT, 20761C-MIA-DC and 20761C-MIA-SQL virtual machines are
running.
2. Log on to 20761C-MIA-SQL as ADVENTUREWORKS\Student with the password Pa55w.rd.
3. Start SQL Server Management Studio.
4. In the Connect to Server dialog box, click Cancel.
5. Close the Object Explorer window by clicking the Close icon.
6. Close the Solution Explorer window by clicking the Close icon.
7. To open the Object Explorer pane, on the View menu, click Object Explorer (or press F8).
8. To open the Solution Explorer pane, on the View menu, click Solution Explorer (or press Ctrl+Alt+L).
Task 2: Configure the Editor Settings
1. In SQL Server Management Studio, on the Tools menu, click Options.
2. In the Options dialog box, expand the Environment option, and then click Fonts and Colors.
3. In the Show settings for list, click Text Editor.
4. In the Size box, set the font size to 14.
5. In the left pane, expand Text Editor, expand Transact-SQL, and then click IntelliSense.
6. In the Transact-SQL IntelliSense Settings section, clear the Enable IntelliSense check box.
7. In the left pane, under Transact-SQL, click Tabs, and then change the Tab size to 6.
8. In the left pane, expand Query Results, expand SQL Server, and then click Results to Grid.
9. Select the Include column headers when copying or saving the results check box, and then click
OK.
Results: After this exercise, you should have opened SSMS and configured editor settings.
MCT USE ONLY. STUDENT USE PROHIBITED
L1-2 Querying Data with Transact-SQL
Exercise 2: Creating and Organizing T-SQL Scripts
Task 1: Create a Project
1. On the File menu, point to New, and then click Project.
2. In the New Project dialog box, click SQL Server Scripts.
3. In the Name box, type MyFirstProject.
4. In the Location box, type D:\Labfiles\Lab01\Starter, and then click OK to create the new project.
5. In Solution Explorer, under MyFirstProject, right-click the Queries folder, and then click New Query.
6. In the Connect to Database Engine dialog box, click Cancel.
7. Under the Queries folder, right-click SQLQuery1.sql, click Rename, type MyFirstQueryFile, and
then press Enter.
8. On the File menu, click Save All.
Task 2: Add an Additional Query File
1. In Solution Explorer, right-click the Queries folder, and then click New Query.
2. In the Connect to Database Engine dialog box, click Cancel.
3. In the Queries folder, right-click SQLQuery1.sql, click Rename, type MySecondQueryFile, and then
press Enter.
4. On the taskbar, click File Explorer.
5. In File Explorer, navigate to the D:\Labfiles\Lab01\Starter\MyFirstProject\MyFirstProject folder to
see where the files have been created.
6. In SQL Server Management Studio, in Solution Explorer, right-click MySecondQueryFile.sql, and
then click Remove.
7. In the Microsoft SQL Server Management Studio dialog box, click Remove.
8. In File Explorer, press F5 to refresh, notice that the file MySecondQueryFile.sql is still there.
9. In SQL Server Management Studio Solution, in Solution Explorer, right-click MyFirstQueryFile.sql,
and then click Remove.
10. In the Microsoft SQL Server Management Studio dialog box, click Delete.
11. In File Explorer, press F5 to refresh, notice that the MyFirstQueryFile.sql file has been deleted.
Task 3: Reopen the Created Project
1. In SQL Server Management Studio Solution, on the File menu, click Save All.
2. On the File menu, click Exit to close the project and SQL Server Management Studio.
3. Open SQL Server Management Studio.
4. In the Connect to Server dialog box, click Cancel.
5. On the File menu, point to Open, and then click Project/Solution.
6. In the Open Project dialog box, navigate to the D:\Labfiles\Lab01\Starter\MyFirstProject folder,
click MyFirstProject.ssmssln, and then click Open.
7. In File Explorer, navigate to the D:\Labfiles\Lab01\Starter\MyFirstProject\MyFirstProject folder.
8. Drag the MySecondQueryFile.sql file to the Queries folder in Solution Explorer.