Re: Is there any limit to Left Join ?

From: Mike Hodgson (mike.hodgson_at_mallesons.nospam.com)
Date: 02/22/05


Date: Tue, 22 Feb 2005 15:36:21 +1100

Nah - no practical limit (the maximum tables per SELECT statement in SQL
Server 8.0 is 256). If you look at the grammar for the FROM clause in
BOL you'll see it's a recursive grammar.

If you were to join a couple hundred tables in your FROM clause you'd
probably hit some limits when you started running out of memory in the
procedure cache for your query plan and the CPU ground to a halt trying
to process the mother of all queries but if you stay under 200 joins in
a single query you should be OK. ;-)

Happy joining!

--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@mallesons.nospam.com |* W* http://www.mallesons.com
Peter wrote:
>I am going to create a query with more than 1 LEFT JOIN.  
>I would like to know is there any limit (Like only 1 can 
>be used) in SQL Server 2000 ?
>
>Thanks
>  
>


Relevant Pages

  • Re: WHERE 1=2 with performance nightmares
    ... Application server enabling technology for developers ... WHERE clause in our sql. ... Has that turned on some kind of server setting that cause all ...
    (borland.public.delphi.non-technical)
  • Re: Using CAST() in WHERE Clause hangs/slows Query
    ... When you use a column in a WHERE clause which has any function on it, SQL ... Server can NOT use index statistics to determine which is the best index to ... Wayne Snyder, MCDBA, SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: Opinions on approach, please...
    ... Write the where clause manually, ... Create a data layer program per table, ... number of bind variable tokens in your dynamic SQL. ... If I do that I'd need to tailor manually every single COM server, ...
    (comp.lang.cobol)
  • Re: sort order
    ... Do you have an ORDER BY clause. ... Server the records are coming back the way you expect them to. ... Mike Epprecht, Microsoft SQL Server MVP ...
    (microsoft.public.sqlserver.setup)
  • RE: Fulltext failure on a 2 node cluster
    ... Server full-text search resource online: "SQL Cluster Resource 'Full Text' ...
    (microsoft.public.sqlserver.clustering)