SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Update Set clause column list issues

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Update Set clause column list issues
Author Message
judahr



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

Post Update Set clause column list issues Reply with quote
v 5.0.82

Code:

Update t2
Set Column1 = t.Column1
From dbo.Table1 t
  Inner join dbo.Table2 t2
    on t.ID = t2.ID


Placing a comma after Column1 should pull up the column list for t2. Since it is the table you are updating. Sometimes you have to hit refresh for it to show anything. Otherwise, it pulls up the column list for t (because it is the first table?). It also always aliases the column, which isn't a huge deal, but unnecessary.
Wed Mar 31, 2010 5:17 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I think it is actually supposed to show columns for whichever table is listed first in the FROM clause first. If you press Arrow Left key or use mouse to collapse that table, you see the second table below the collapsed level, and so on. As far as I know, the handling of FROM clause in UPDATE statements is no different from handling of FROM clause in any other statement type.
Wed Mar 31, 2010 7:19 pm View user's profile Send private message
judahr



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

Post Reply with quote
This could be an enhancement. I think for an update it makes more sense to show the updated table first.
Thu Apr 01, 2010 8:42 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
It sure makes more sense to have columns of the updated table first. This is a good candidate for an enactments. I'm going to submit that to the tracking system.

PS. In the current version, the working of SQL Intellisense for FROM clause is not specific to any database type or statement type and doesn't recognize proprietary SQL Server extensions like use of table aliases in the UPDATE statements (actually that was invented by Sybase before it was licensed and inherited by Microsoft)
Thu Apr 01, 2010 10:08 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.