  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			lis_s 
			 
			
  
			
			
				Joined: 14 Mar 2013 Posts: 2 Country: Russian Federation | 
			 
			  
		 | 
		
			
				  Automatically add "AS" before table alias | 
				     | 
			 
			
				Hi all!
 
 
Is there any way to tell SA to put "AS" before aliases?
 
 
For example:
 
I need the following query
 
 
	  | 
	
 
	  | 
	
 
select * from MyTable
 
 | 
	 
 
 
 
to be formatted like this
 
 
	  | 
	
 
	  | 
	
 
select * from MyTable as mt
 
 | 
	 
 
  | 
			 
		  | 
	 
	
		| Thu Mar 14, 2013 10:43 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Options dialog -> DB Options table -> select SQL Assistance type on the left -> Expand Auto complete ... section on the right. -> Auto Add Aliases from "Yes" to "Yes (with AS keyword)" -> click OK button
  | 
			 
		  | 
	 
	
		| Thu Mar 14, 2013 10:38 pm | 
		          | 
	 
	
		  | 
	 
	
		
			lis_s 
			 
			
  
			
			
				Joined: 14 Mar 2013 Posts: 2 Country: Russian Federation | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				
	  | 
	
 
	  | 
	Options dialog -> DB Options table -> select SQL Assistance type on the left -> Expand Auto complete ... section on the right. -> Auto Add Aliases from "Yes" to "Yes (with AS keyword)" -> click OK button | 
	 
 
 
 
Thanks a lot!
  | 
			 
		  | 
	 
	
		| Fri Mar 15, 2013 1:20 am | 
		          | 
	 
	
		  | 
	 
	
		
			Olegon 
			 
			
  
			
			
				Joined: 07 Sep 2009 Posts: 40
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Doesn't work with joins :(
 
 
Example:
 
	  | 
	
 
	  | 
	select
 
  *
 
from
 
  dbo.Contractors as c
 
  inner join dbo.Banks b
 
    on
 
      b.contractor_rid = c.record_id | 
	 
 
 
 
After I wrote "inner join" I chose table name from the joins list. Table alias added without "as".
  | 
			 
		  | 
	 
	
		| Thu Apr 04, 2013 7:28 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				Thank you. I will log this issue to our support system
  | 
			 
		  | 
	 
	
		| Thu Apr 04, 2013 8:01 am | 
		          | 
	 
	
		  | 
	 
	
		
			gemisigo 
			 
			
  
			
			
				Joined: 11 Mar 2010 Posts: 2175
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				
	  | 
	
 
	  | 
	Doesn't work with joins :(
 
 
Example:
 
	  | 
	
 
	  | 
	select
 
  *
 
from
 
  dbo.Contractors as c
 
  inner join dbo.Banks b
 
    on
 
      b.contractor_rid = c.record_id | 
	 
 
 
 
After I wrote "inner join" I chose table name from the joins list. Table alias added without "as". | 
	 
 
 
 
Strange indeed. It works properly when selecting the table from joins list but fails when selecting the join condition.
  | 
			 
		  | 
	 
	
		| Thu Apr 04, 2013 8:28 am | 
		          | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
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
  | 
   
 
		 | 
	 
	  |