• If I understand what you desire to do correctly, this should do the job.

    CREATE TABLE T(COMCOD nchar(4), ACTCODE nvarchar(6), ACTDESC nvarchar(250),

    PRIMARY KEY (ACTCODE))

    INSERT INTO T

    SELECT '3306', '180001','ADVANCE TO STAFF' UNION ALL

    SELECT '3306', '180002','ADVANCE TO OTHERS' UNION ALL

    SELECT '3306', '180003','ADVANCE TO SITE OFFICE'

    UPDATE T SET ACTCODE = '190' + SUBSTRING(ACTCODE,4,3)

    WHERE SUBSTRING(ACTCODE,1,3) = '180'

    Results:

    COMCODACTCODEACTDESC

    3306 190001 ADVANCE TO STAFF

    3306 190002ADVANCE TO OTHERS

    3306 190003ADVANCE TO SITE OFFICE

    Remember to test, and then test again before using in a Production database

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]