nested loops in outer joins

  • Can a right outer join be run as a nested loop? If so, how can you force SQL server to do this?

  • When you ask if it can nest on itself directly with nothing else the answer is no. If you are talking about a while loop and collect the data as you loop thru the nesting, then yes it is very easy. Can you be more specific with you details of your question?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • I think the following info from the http://www.sqlmag.com/Articles/Index.cfm?ArticleID=7443&pg=3 might help you out:

    With no hint, the query optimizer decides the order of the joins on a cost-based estimation, regardless of their order in the SQL statement. To force the join order for a certain query, use the FORCE ORDER query hint. FORCE ORDER isn't a JOIN hint because it doesn't appear in the FROM clause. Alternatively, you can force the query processor to use your specified join order for all queries in the session level by using SET FORCEPLAN ON.

  • My question was that I have 2 tables that are being right outer joined in a query. Can I get this join to run as a nested loop? When I try to force it to do this using a hint, I get a syntax error.

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

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