 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
Update Set clause column list issues |
|
v 5.0.82
 |
 |
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
judahr
Joined: 09 Mar 2007 Posts: 319 Country: United States |
|
|
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
|
|
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
|
|
|