Friday, February 24, 2012

Is there any limit to Left Join ?

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 ?
ThanksThis is a multi-part message in MIME format.
--050208090800080108030302
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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
>
--050208090800080108030302
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>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.<br>
<br>
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. <span class="moz-smiley-s3"><span>
;-) </span></span><br>
<br>
Happy joining!</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
Peter wrote:
<blockquote cite="mid0e3f01c51894$b60fc380$a401280a@.phx.gbl" type="cite">
<pre wrap="">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
</pre>
</blockquote>
</body>
</html>
--050208090800080108030302--|||"Mike Hodgson" <mike.hodgson@.mallesons.nospam.com> wrote in message
news:OlTsSgJGFHA.3908@.TK2MSFTNGP12.phx.gbl...
> but if you stay under 200 joins in a single query you should be OK. ;-)
LOL! I love a well-designed database... :-)

No comments:

Post a Comment