Sample Data and Workload

This example shows how to use SQL Server performance tools. First, the table is constructed:

CREATE TABLE testtable (nkey1 int IDENTITY, col2 char(300) DEFAULT 'abc', ckey1 char(1))

  

Next, the table is loaded with 10,000 rows of test data:

DECLARE @counter int

SET @counter = 1

WHILE (@counter <= 2000)

BEGIN

    INSERT testtable (ckey1) VALUES ('a')

    INSERT testtable (ckey1) VALUES ('b')

    INSERT testtable (ckey1) VALUES ('c')

    INSERT testtable (ckey1) VALUES ('d')

    INSERT testtable (ckey1) VALUES ('e')

    SET @counter = @counter + 1

END

  

These queries comprise the database server workload:

SELECT ckey1,col2 FROM testtable WHERE ckey1 = 'a' 

select nkey1,col2 FROM testtable WHERE nkey1 = 5000