Solved

SQL Question pertaining to JOINS

Posted on 2009-06-27
1
178 Views
Last Modified: 2012-05-07
Is there a maximum amount of Joins allowed per SELECT statement? I have one that will contain numerous Joins, would I be best served to break them all into temp tables and re-join them? What would be my best way to handle this?
0
Comment
Question by:Jeff S
1 Comment
 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 500 total points
ID: 24727675

<<s there a maximum amount of Joins allowed per SELECT statement?>>
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_21855910.html

<<I have one that will contain numerous Joins, would I be best served to break them all into temp tables and re-join them? >>
It really depends on the structure and the type of joins.  Sometime it is better to use temp tables to avoid blocking sometimes it's not.  Hard to say without knowing both your schema and statement.

<<What would be my best way to handle this?>>
I would suggest you start without using any temp table then test yo see if you have blockings.  If you detect specific blockings or slow performance then you can consider replacing joins by temp tables.  most of the time, if the indexing is well done, temm tables are unecessary but sometime there are no other way.

HTH
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now