Results 1 to 4 of 4

Thread: Recursive Query

  1. #1
    Join Date
    Feb 2005
    Posts
    21

    Unanswered: Recursive Query

    Are there any downfalls in using recursive queries. Also, if a temp table created by a recursive query is larger than the allocated space, can it cause the database to crash?

    With
    Table1 As(Select ...)

    Select ... from Table1;

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    1. What you quote in your message is not a recursive query.
    2. Common table expression (the "WITH" part) does not necessarily create a temporary table.
    3. If the database manager runs out of temporary space it shouldn't crash. However, the query itself will fail. Other queries may also fail if they use the temporary space as well.
    Last edited by n_i; 02-24-05 at 17:07.

  3. #3
    Join Date
    Feb 2005
    Posts
    21

    Thumbs up

    Thanks a lot. I thought a common table expression always created a temp table for the duration of the select.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    You can always look at the execution plan to see whether any particular query does it or not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •