| Author | 
		Message | 
	
	
		
			judahr 
			 
			
  
			
			
				Joined: 09 Mar 2007 Posts: 320 Country: United States | 
			 
			  
		 | 
		
			
				  Fully Qualified Object Names not working for selected joins | 
				     | 
			 
			
				v. 5.0.96 Pro
 
Option Always Fully Qualify Object Names: "With schema name"
 
 
Select field1
 
From dbo.Table1 t
 
    INNER JOIN 
 
 
At this point you get a popup list of possible foreign keys.  If you select one the foreign keys the table names aren't fully qualified anymore.
  | 
			 
		  | 
	
	
		| Fri Apr 30, 2010 4:37 pm | 
		          | 
	
	
		  | 
	
	
		
			judahr 
			 
			
  
			
			
				Joined: 09 Mar 2007 Posts: 320 Country: United States | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				5.0.97 - same issue.
 
 
To clarify:
 
 
Select field1 
 
From dbo.Table1 t 
 
INNER JOIN 
 
 
 
Selecting a foreign key results in:
 
 
Select field1 
 
From dbo.Table1 t 
 
INNER JOIN Table2 t2 on t.field1 = t2.field1
 
 
in should say 
 
 
Select field1 
 
From dbo.Table1 t 
 
INNER JOIN dbo.Table2 t2 on t.field1 = t2.field1
  | 
			 
		  | 
	
	
		| Mon May 24, 2010 10:44 am | 
		          | 
	
	
		  | 
	
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Thank you! I entered new issue to our internal tracking system. Bug id SA-10638
  | 
			 
		  | 
	
	
		| Mon May 24, 2010 11:21 am | 
		          | 
	
	
		  | 
	
	
		
			Olegon 
			 
			
  
			
			
				Joined: 07 Sep 2009 Posts: 40
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				It is necessary functional.
 
When will be fixed?
 
Thanks
  | 
			 
		  | 
	
	
		| Mon Jun 21, 2010 1:19 am | 
		          | 
	
	
		  | 
	
	
		
			gemisigo 
			 
			
  
			
			
				Joined: 11 Mar 2010 Posts: 2175
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				You can bypass that (until it's fixed) by not selecting the foreign key but the table first (that way it gets qualified) and after typing keyword 'ON' you can still select the foreign key. It's a bit messy and requires a few more keypresses but at least the tablenames get qualified. 
 
 
By the way, it would be nice to have a hotkey for Refactoring -> Qualify object names. Currently it can only be reached from (popup)menu...
  | 
			 
		  | 
	
	
		| Mon Jun 21, 2010 3:29 am | 
		          | 
	
	
		  | 
	
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				That fix will be available in the next maintenance release 5.1. 
 
 
If you are interested in an early preview, please email to support and ask for a download link for a private build 5.0.120 or a later build.
  | 
			 
		  | 
	
	
		| Mon Jun 21, 2010 9:02 am | 
		          | 
	
	
		  | 
	
	
		
			gemisigo 
			 
			
  
			
			
				Joined: 11 Mar 2010 Posts: 2175
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Is there a changelog for that build?
  | 
			 
		  | 
	
	
		| Mon Jun 21, 2010 9:32 am | 
		          | 
	
	
		  | 
	
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				I'm not sure if you refer to 5.1 or 5.0.120. Change log for 5.1 is incomplete, that one is not yet available. If you mean 5.0.120, this build contains all incremental changes made since 5.0.97 including bug fixes and some new features.  This is a private build, which is available to users with effective license maintenance and provided upon request or recommended by tech support to resolve certain known issues - schema name qualification in joins is among them.
  | 
			 
		  | 
	
	
		| Mon Jun 21, 2010 11:41 am | 
		          | 
	
	
		  | 
	
	
		
			judahr 
			 
			
  
			
			
				Joined: 09 Mar 2007 Posts: 320 Country: United States | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				5.0.120 doesn't resolve the issue.
  | 
			 
		  | 
	
	
		| Thu Jun 24, 2010 9:43 am | 
		          | 
	
	
		  | 
	
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				It appears that you need to reload default SQL Assistant settings for JOIN query definitions in order for that fix to work correctly. Please let us know if that doesn't help.
  | 
			 
		  | 
	
	
		| Thu Jun 24, 2010 6:20 pm | 
		          | 
	
	
		  | 
	
	
		
			judahr 
			 
			
  
			
			
				Joined: 09 Mar 2007 Posts: 320 Country: United States | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Is there a way I can get it without messing up my settings?
  | 
			 
		  | 
	
	
		| Fri Jun 25, 2010 11:16 am | 
		          | 
	
	
		  | 
	
	
		
			gemisigo 
			 
			
  
			
			
				Joined: 11 Mar 2010 Posts: 2175
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				As I see, it's enough to only reload the DB Queries part of setup.sas. You probably did not change those. Personally, I exported my settings, reloaded the default, and after that  imported snippets and formatting settings from the export to overwrite defaults.
  | 
			 
		  | 
	
	
		| Fri Jun 25, 2010 2:36 pm | 
		          | 
	
	
		  | 
	
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				That's correct. Reloading just db queries should be enough. 
 
 
By the way, I found out today that the referenced fix for qualifying table names in table joins fixes schema/table name qualifications, but doesn't fix cases for database/schema/table names. It appears that a more recent fix is already available for dealing with database/schema/name auto-qualified names in table joins.
  | 
			 
		  | 
	
	
		| Fri Jun 25, 2010 10:54 pm | 
		          | 
	
	
		  | 
	
	
		
			Olegon 
			 
			
  
			
			
				Joined: 07 Sep 2009 Posts: 40
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				5.1.7 doesn't work
 
 
Option Always Fully Qualify Object Names: "With database and schema names" 
 
 
Example:
 
	  | 
	
 
	  | 
	use master
 
go
 
 
select
 
  *
 
from
 
  Northwind.dbo.Categories c
 
  inner join | 
	 
 
 
 
Selecting a foreign key:
 
 
	  | 
	
 
	  | 
	select
 
  *
 
from
 
  Northwind.dbo.Categories c
 
  inner join master.dbo.Products p
 
    on
 
      p.CategoryID = c.CategoryID | 
	 
 
 
 
 
mast be:
 
 
	  | 
	
 
	  | 
	select
 
  *
 
from
 
  Northwind.dbo.Categories c
 
  inner join Northwind.dbo.Products p
 
    on
 
      p.CategoryID = c.CategoryID | 
	 
 
 
 
In old version (4.8.29) was OK. Why in new versions so bad?
  | 
			 
		  | 
	
	
		| Thu Aug 19, 2010 5:56 am | 
		          | 
	
	
		  | 
	
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Thank you. This example is very helpful. I can reproduce this too. The fix doesn't work when the current database context is not the same as in database containing the referenced tables. I'll report this to the development
  | 
			 
		  | 
	
	
		| Thu Aug 19, 2010 8:20 am | 
		          | 
	
	
		  | 
	
	
		 |