Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Multiple joins
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

169 Posts

Posted - 10/16/2012 :  10:02:47  Show Profile  Reply with Quote
I need to write a query that selects records from multiple tables including a subquery but I belive I do something wrong since the select takes "forever" to run and the tempdb fills up quickly.

Smaller example:

from tbl1 a inner join
(select, b1.col2, c1.col3 from subTbl1 a1 inner join subTbl2 b1 on = inner join subTbl3 c1 on =
where a1.val = 'Yes') as fa
on = inner join tbl2 e on =
inner join tbl3 f on =

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 10/16/2012 :  23:13:03  Show Profile  Reply with Quote
did you check the execution plan? what are the indexes table have?

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000