October 24, 2013 at 11:15 am
I need help please on the following:
I have a query that updates a column of a table A. When I run the query it returns a message that 3 rows were updated. When I check the values of the rows that should be updated, they still have different values although it says they were updated. Any one encountered the same problem and resolved it?
update A
set A.columnC = B.ColumnD
from table A
join table B
ON A.ID = B.ID
where A.columnC <> B.ColumnD
October 24, 2013 at 11:36 am
Seems to me several rows in table B match a row in A so the A row would be set three times. Without an ORDER BY there is no way to know which B row value it will be set to.
October 24, 2013 at 1:20 pm
I am looking into that thank you!
October 24, 2013 at 1:32 pm
Trigger on the table?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply