Try this
UPDATE table1 AS a
SET value1 = x.value1
FROM table2 AS x
WHERE x.code = a.something
Evan Carroll
2010-03-22 18:47:50
Try this
UPDATE table1 AS a
SET value1 = x.value1
FROM table2 AS x
WHERE x.code = a.something
Sounds like it should work like this:
Update table1 Set value1 =
( Select value1
From table2
Where table2.code = table1.something
)
UPDATE is notoriously different across different DBMSes. But try something along these lines:
UPDATE Table1 SET Value1 =
(SELECT Value1 FROM Table2 WHERE code = Table1.Something)
"I am using Microsoft SQL Server 6.5"?? Why? Why don't you get the FREE SQL 2008 Express edition or if you qualify, SQL 2008 Developers Edition for about USD50?
UPDATE Table1, Table2
SET Table1.Value1 = Table2.Value1
WHERE Table2.Code = Table1.Something
Does this help?
Try this one:
update table1
set value1 = x.value1
from table2 x
where something = x.code
Have you tried something like this :-
UPDATE table1
SET x.Value1=y.Value1
FROM Table1 x INNER JOIN
Table2 y ON x.Code=y.Something