Here is the Stored Proc
DECLARE @cols NVARCHAR(2000),
@query NVARCHAR(4000)
/*
SET @StartDate = '10/01/2002'
SET @EndDate = '10/31/2008'
SET @SiteKey = '88,89,90,91'
SET @TraitKey = '1,2,3,4,5,6,7,8,9,10,11'
*/
SELECT @cols = STUFF((SELECT DISTINCT TOP 100 PERCENT '], [' +...