Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error =SET OPTION SQL_BIG_SELECTS=1

Status
Not open for further replies.

JonathanG6SWJ

Programmer
Jan 18, 2005
39
GB
Here I was putting the finishing touches to my first, quite complex (well for me anyway) asp/db application and then I add a few more test records to my db.... the result the following error message...


CODE
Vbscript Runtime error 'ASP 0185 : 3219'
General error: The SELECT would examine too many records and probably take a very long time. Check your WHERE and use SET OPTION SQL_BIG_SELECTS=1 if the SELECT is ok

Well to the best of my knowledge my WHERE could not be more simple and all the tables concerned don't have that many records.

I've scanned the net but cannot find an obvious answer.
Any clues... if I need to use "SET OPTION...
how do I do this within ASP.

Here's the statement


Code:
SELECT tblCompetencyGroups.intCompetencyGroup_obj_no, tblCompetencyGroups.strCompetencyGroupText, tblCompetencies.intCompetency_obj_no, tblCompetencies.strCompetencyText, tblCompetencies.strAltFormatText, tblResultsData.intDelegate_obj_no, tblResultsData.intPerson_obj_no, tblResultsData.intA_obj_no, tblResultsData.intAScore, tblResultsData.intB_obj_no, tblResultsData.intBScore FROM ((tblCompetencies INNER JOIN tblCompetencyClusters ON tblCompetencies.intCompetency_obj_no = tblCompetencyClusters.intCompetency_obj_no) LEFT JOIN tblCompetencyGroups ON tblCompetencyClusters.intCompetencyGroup_obj_no = tblCompetencyGroups.intCompetencyGroup_obj_no) INNER JOIN tblResultsData ON tblCompetencies.intCompetency_obj_no = tblResultsData.intCompetency_obj_no WHERE (((tblResultsData.intDelegate_obj_no)=1) AND ((tblResultsData.intPerson_obj_no)=57)) ORDER BY tblCompetencies.intCompetency_obj_no;

When I remove the ORDER BY statement all works OK.
I'm only returning 65 records - what am I doing wrong?


As always many thanks in advance.
Jonathan
 
Hopefully that's a bit easier to read!

Code:
SELECT tblCompetencyGroups.intCompetencyGroup_obj_no, tblCompetencyGroups.strCompetencyGroupText, tblCompetencies.intCompetency_obj_no, tblCompetencies.strCompetencyText, tblCompetencies.strAltFormatText, tblResultsData.intDelegate_obj_no, tblResultsData.intPerson_obj_no, tblResultsData.intA_obj_no, tblResultsData.intAScore, tblResultsData.intB_obj_no, tblResultsData.intBScore

FROM ((tblCompetencies INNER JOIN tblCompetencyClusters
ON tblCompetencies.intCompetency_obj_no = tblCompetencyClusters.intCompetency_obj_no)

LEFT JOIN tblCompetencyGroups ON tblCompetencyClusters.intCompetencyGroup_obj_no = tblCompetencyGroups.intCompetencyGroup_obj_no)

INNER JOIN tblResultsData ON tblCompetencies.intCompetency_obj_no = tblResultsData.intCompetency_obj_no

WHERE (((tblResultsData.intDelegate_obj_no)=1)
AND ((tblResultsData.intPerson_obj_no)=57)

ORDER BY tblCompetencies.intCompetency_obj_no;

Jonathan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top