Using the SQL UPDATE statement how can I copy a columns data say from column A in Table A to column B in Table B?
Note that I am using Microsoft SQL Server 2000
I try doing the following:
UPDATE B SET B.column_B = A.column_A
FROM Table_A A, Table_B B
WHERE A.numID = B.numID AND A.Line = B.Line
but it did not work so I try this
UPDATE Table_B
SET column_B = (SELECT column_A FROM Table_A WHERE Table_A.numID = 233)
WHERE Table_B.numID = 233
When I do this one I get the following error msg:
Server: Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. The statement has been terminated.
I am trying to copy all the values of column A in Table A to column B in Table B.
Any suggestions or hints are welcome




Bookmarks