Is there a way to have a stored procedure return the results of approximately 50 queries as a single recordset? Each query returns the number of records matching a particular parameter and I need the results of 50 queries to populate a results table on an ASP page. The individual queries are all similar to the following:
SELECT COUNT(MishapID) AS CRW --CRW is the variable string
FROM dbo.tblMishaps
WHERE (MishapID IN
(SELECT DISTINCT tblMishaps.MishapID
FROM tblMishaps, tblFactors, tblMishapFactors
WHERE tblMishaps.MishapID = tblMishapFactors.MishapID_FK
AND
tblFactors.[3rdLevelCode] = tblMishapFactors.[3rdLevelCode_FK]
AND (tblFactors.[2ndLevelCode] = 'CRW')))
How do I return all the results to the calling ASP page, individually or as a combined recordset?
SELECT COUNT(MishapID) AS CRW --CRW is the variable string
FROM dbo.tblMishaps
WHERE (MishapID IN
(SELECT DISTINCT tblMishaps.MishapID
FROM tblMishaps, tblFactors, tblMishapFactors
WHERE tblMishaps.MishapID = tblMishapFactors.MishapID_FK
AND
tblFactors.[3rdLevelCode] = tblMishapFactors.[3rdLevelCode_FK]
AND (tblFactors.[2ndLevelCode] = 'CRW')))
How do I return all the results to the calling ASP page, individually or as a combined recordset?