I try following #queries, I get following #results.It seems to be worked.Perhaps, there is not enough information.You can show small reproducibility set, tables schema, datas, or difference between your environment and following #queries.--#resultsSELECT 1 isprojeid building bin1 NOT CHANGE-1 NOT CHANGE-12 NOT CHANGE-2 NOT CHANGE-2SELECT 2 isprojeid building bin1 CHANGED-1 CHANGED-12 CHANGED-2 CHANGED-2
-----------------------------------------------------------#queriesCREATE TABLE tab_ccsnetrm( projeid int NOT NULL, building varchar(100) NOT NULL, bin varchar(100) NOT NULL)CREATE TABLE table_rm( projid int NOT NULL, rmtitle varchar(100) NOT NULL)CREATE TABLE tab_projects( projid int NOT NULL, projno int NOT NULL)CREATE TABLE Bodega_small( clientid int NOT NULL, bldg_Title varchar(100) NOT NULL, Edificio varchar(100) NOT NULL, caja varchar(100) NOT NULL)INSERT INTO tab_ccsnetrm VALUES (1, 'NOT CHANGE-1', 'NOT CHANGE-1'), (2, 'NOT CHANGE-2', 'NOT CHANGE-2')INSERT INTO table_rm VALUES (1, 'OPERACIONES Y PAGOS 08/02/2010 30/12/2010'), (2, 'NO SLASHES CONTAINS')INSERT INTO tab_projects VALUES (1, 1), (2, 2)INSERT INTO Bodega_small VALUES (1 ,'OPERACIONES Y PAGOS 08/02/2010 30/12/2010', 'CHANGED-1', 'CHANGED-1'), (2, 'NO SLASHES CONTAINS', 'CHANGED-2', 'CHANGED-2')--SELECT 1SELECT * FROM tab_ccsnetrmupdate tab_ccsnetrm set [building] = t2.Edificio, [bin] = t2.cajafrom table_rm t1inner join tab_projects proj on(t1.projid = proj.projid)inner join Bodega_small t2 on ltrim(rtrim(proj.projno)) = ltrim(rtrim(t2.clientid)) and ltrim(rtrim(t1.rmtitle)) = ltrim(rtrim(t2.bldg_Title))--SELECT 2SELECT * FROM tab_ccsnetrmDROP TABLE tab_ccsnetrmDROP TABLE table_rmDROP TABLE tab_projectsDROP TABLE Bodega_small
-------------------------------------From JapanSorry, my English ability is limited.