Thanks for the help! I will use this guidance to try to solve the problem ... if you have time and wouldn't mind - I am not yet clear on how to create/name the cursor and populate the @TestNameVariable ... the beginning/surrounding code...
THX again.
quote:
You'll have to build a dynamic sql statement in a loop. Loop on the number of tests creating a select statement like this:declare @SqlClause as varchar(500)
select @SqlClause = 'select StudentId, '
--in cursor loop
fetch into @TestNameVariable
@SqlClause = @SqlClause + @TestNameVariable
fetch next...
--then execute the @SqlClause
exec( @SqlClause)
Darren