-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Written by Kimberly L. Tripp - all rights reserved.
-- 
-- For more scripts and sample code, check out 
-- 	http://www.SQLSkills.com
-- For "More than Just Training," see the Industry Experts at 
-- 	http://www.SolidQualityLearning.com
--
-- Disclaimer - Thoroughly test this script, execute at your own risk.
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-- Table Scan
set statistics io on
go

SELECT LastName, FirstName, Phone_No
FROM Member with (Index (0))
WHERE LastName LIKE '[S-Z]%'
go

--CREATE INDEX MemberLastName ON Member(LastName)
go

SELECT LastName, FirstName, Phone_No
FROM Member with (index (MemberLastName))
WHERE LastName LIKE '[S-Z]%'
go

--CREATE INDEX NCLastNameCombo ON Member(LastName, FirstName, Phone_No)
go

SELECT LastName, FirstName, Phone_No
FROM Member 
WHERE LastName LIKE '[S-Z]%'
go

--CREATE INDEX NCLastNameCombo2 ON Member(FirstName, LastName, Phone_No)
go

SELECT LastName, FirstName, Phone_No
FROM Member with (INDEX (NCLastNameCombo2))
WHERE LastName LIKE '[S-Z]%'
go
