SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA Beta 6] Join Suggestion

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA Beta 6] Join Suggestion
Author Message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post [SA Beta 6] Join Suggestion Reply with quote
v 6.0.33

Assuming a FK relationship exists between Table1 and Table2 on Field names that are not named the same.
Code:
Select *
From dbo.Table1 t
    Left Outer Join dbo.Table2 tCustom
         ON tCustom.Field2 =


At this point join suggestions appear, but for tables not in the query. If you select one, you get something like this:

Code:
 ON tCustom.Field2 = dbo.Table3 t3 ON t3.Field3 = tCustom.Field2


I think = should show join suggestions for tables that are in the query, not those that are not. ... JOIN is good to show the FK's
Thu Jul 14, 2011 4:13 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7907

Post Reply with quote
It offers join suggestions for all known foreign keys for all tables referenced in the query. If you select one of them, SQL Assistant will generate and insert the complete JOIN clause, including table names, aliases, and not just column names.

It is much more efficient to select required joins immediately after typing JOIN keyword by column references in that box, rather than typing JOIN then selecting a table then typing ON keyword then typing an alias then selecting a column then typing equal sign and so on...
Thu Jul 14, 2011 6:46 pm View user's profile Send private message
judahr



Joined: 09 Mar 2007
Posts: 319
Country: United States

Post Reply with quote
Yes, I'm familiar with the join suggestion feature. I think the issue is showing or inserting tables after an = sign. After the join keyword makes sense. but = should show candidate columns only.

Here is what would make more sense (and how I thought it has been working prior to 6). After typing this: you get this

Join: Candidate joins with table names and column pairs. Tables limited to FK's to tables currently with relationships. Both the chosen table and column pairs inserted.
On: Candidate joins with table names and column pairs. Limited to only currently reference tables. Chosen column pairs only inserted.
= or between or similar: Candidate columns. Limited to only currently referenced tables. Preference given to either the table for the current join clause (or if that table is already on the left side of the equal, another table in the query). Chosen column name inserted only.
Fri Jul 15, 2011 10:13 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.