Module 4 Lab: Creating Indexes
Module 4 Lab: Creating Indexes
Module 4 Lab: Creating Indexes
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, and then click
SQL Server Management Studio.
2. In the Connect to Server dialog box, specify the values in the following table, and then click
Connect.
Property Value
Server type Database Engine
Server name MIAMI
Authentication Windows Authentication
1. On the Project menu, click New Query. When prompted, use Microsoft Windows®
authentication to connect to MIAMI.
2. If Solution Explorer is not visible, click Solution Explorer on the View menu.
3. In Solution Explorer, right-click SQLQuery1.sql, and then click Rename. Rename the file
CreateIndex.sql.
4. In the query window, type the following Transact-SQL code to create the
Ix_Product_Supply_Chain index.
USE AdventureWorks
CREATE UNIQUE NONCLUSTERED INDEX Ix_Product_Supply_Chain
ON Production.Product (ProductNumber, Color, ReorderPoint,
SafetyStockLevel)
INCLUDE (DaysToManufacture)
WITH (ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = OFF, FILLFACTOR = 90,
PAD_INDEX = ON)
1. On the Project menu, click Add Existing Item and add the Queries.sql file in the
D:\Labfiles\Starter folder. When prompted, connect to MIAMI.
2. Examine the queries in the file. You will use these queries to analyze the indexes in the
AdventureWorks database.
1. Click Start, point to All Programs, point to Microsoft SQL Server 2005, point to
Performance Tools, and then click Database Engine Tuning Advisor.
2. In the Connect to Server dialog box, specify the values in the following table, and then click
Connect.
Property Value
Server type Database Engine
Server name MIAMI
Authentication Windows Authentication
1. On the Project menu, click New Query. When prompted, use Windows authentication to
connect to MIAMI.
2. In Solution Explorer, right-click SQLQuery1.sql, and then click Rename. Rename the file
CreateXMLIndexes.sql.
1. In the query window, type the following code to create the primary XML index on the
Diagram column of the Production.Illustration table.
USE AdventureWorks
SET ARITHABORT ON
2. In the query window, type the following code to create the secondary path XML index on the
Diagram column of the Production.Illustration table.