More oddities with table variables
declare @tab table
(
PK char(8),
XC char(3),
XS varchar(8),
XT char(3)
)
create table s
(
PK char(8),
C char(3),
S varchar(8),
T char(3)
)
This code works
update @tab
set
XC = s.C,
XS = s.S,
XT = s.T
from @tab p , s
where p.PK = s.PK
But if you do the update of the columns in a different order like this...
update @tab
set
XS = s.S,
XC = s.C,
XT = s.T
from @tab p , s
where p.PK = s.PK
you get
Invalid column name 'XC'.
Invalid column name 'XT'.
I'm beginning to wonder about the implementation of table variables.