I have tried running the following UPDATE on a table with about 25k rows and its been running for over 24hours and it has not completed. I only need to run this UPDATE once so time is not too much of an issue, but anything that long is just not going to work for me. The UPDATE statement does work as I have tried running it in isolation on just a few records, but when you apply it over the full table is when it bogs down.
Im certain that the LIKE is causing the slow down, but I do not have any idea how to make this any simpler or faster, any clues would be appreciated:
UPDATE INVENTORY i2
SET i2.BVRTLPRICE01 =
(SELECT i1.BVRTLPRICE01 FROM INVENTORY i1
WHERE
i1.CODE = REPLACE(LEFT(i2.CODE,1), 'S', 'C') + SUBSTRING(i2.CODE,2,LENGTH(i2.CODE)))
WHERE
i2.CODE like 'S%'