Web Listing 4: Sample Schema and Data CREATE TABLE dbo.InstrStats ( InstrId INT NOT NULL , Msr1 INT NULL, Msr2 DECIMAL(28,10) null, Msr3 INT NULL, Msr4 INT NULL , Msr5 decimal(15,8) NULL, Msr6 bigint NULL, Msr7 bigint NULL, Msr8 INT NULL , Msr9 INT NULL, Msr10 DECIMAL(38,4) NULL , CreateTime datetime NOT NULL DEFAULT(CURRENT_TIMESTAMP) ); INSERT INTO dbo.InstrStats (InstrId, Msr1, Msr2, CreateTime) VALUES( 1, (rand()*100000) +1, rand() * 1000, '2007-04-01T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr1, Msr2, CreateTime) VALUES( 1, (rand()*100000) +1, rand()* 1000, '2007-04-01T00:10:10.200'); INSERT INTO dbo.InstrStats (InstrId, Msr6, Msr5, CreateTime) VALUES( 1, (rand()*100000) +1, rand() * 100000, '2007-04-02T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr3, Msr4, CreateTime) VALUES( 1, (rand()*100000) +1, (rand()*100000) +1, '2007-04-02T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr3, Msr4, CreateTime) VALUES( 1, (rand()*100000) +1, (rand()*100000) +1, '2007-04-02T00:10:10.200'); INSERT INTO dbo.InstrStats (InstrId, Msr3, Msr5, CreateTime) VALUES( 1, (rand()*100000) +1, rand() * 1000, '2007-04-04T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr3, Msr5, CreateTime) VALUES( 1, (rand()*100000) +1, rand()* 1000, '2007-04-04T00:10:10.200'); INSERT INTO dbo.InstrStats (InstrId, Msr4, Msr2, CreateTime) VALUES( 1, (rand()*100000) +1, rand() * 100000, '2007-04-05T00:10:10.200'); INSERT INTO dbo.InstrStats (InstrId, Msr1, Msr6, CreateTime) VALUES( 1, (rand()*100000) +1, (rand()*100000) +1, '2007-04-06T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr1, Msr2, CreateTime) VALUES( 2, (rand()*100000) +1, rand() * 1000, '2007-04-08T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr1, Msr2, CreateTime) VALUES( 2, (rand()*100000) +1, rand()* 1000, '2007-04-08T00:10:10.200'); INSERT INTO dbo.InstrStats (InstrId, Msr6, Msr5, CreateTime) VALUES( 2, (rand()*100000) +1, rand() * 100000, '2007-04-09T00:10:10.200'); INSERT INTO dbo.InstrStats (InstrId, Msr3, Msr4, CreateTime) VALUES( 2, (rand()*100000) +1, (rand()*100000) +1, '2007-04-10T00:10:10.100'); INSERT INTO dbo.InstrStats (InstrId, Msr3, Msr4, CreateTime) VALUES( 2, (rand()*100000) +1, (rand()*100000) +1, '2007-04-10T00:10:10.200');