The query processor ran out of STACK SPACE

  • When I run a query with a few no of unions I see that it gives and error:

    Server: Msg 8621, Level 17, State 1, Line 1

    Internal Query Processor Error: The query processor ran out of stack space during query optimization.

    The query goes like this

     

    SELECT 1,171

    UNION

    SELECT 1,172

    UNION

    SELECT 1,173

    UNION

    SELECT 1,174

    and so on for some 1500 unions.

    Does anyone have a clue on this ?

     

    Thanks in advance for any reponses

     

  • This was removed by the editor as SPAM

  • why using 1500 unio's ??

    You can better create a temp table with two columns and fill this one up using a loop starting with 1,171 and ending with 1,1671 and query the values from the temp table.

    Just a thought..

    GKramer

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply