UPDATE sc SET
    sc.SinConMat = ac.CTR_Matricula
    FROM TESISSEG.dbo.SinCon sc
INNER JOIN TESISSEG.dbo.AS_CONTRARIOS ac
ON ac.SinConNum = sc.SinConNum AND ac.SinNumID = sc.SinNumID AND ac.SinSer = sc.SinSer AND ac.EmpID = sc.EmpID
WHERE trim(sc.SinConMat) = '' AND TRIM(ac.CTR_Matricula) != '' AND TRIM(sc.SinConMat) != TRIM(ac.CTR_Matricula)
UPDATE sc SET
    sc.SinConNPol = ac.CTR_Poliza
    FROM TESISSEG.dbo.SinCon sc
INNER JOIN TESISSEG.dbo.AS_CONTRARIOS ac
ON ac.SinConNum = sc.SinConNum AND ac.SinNumID = sc.SinNumID AND ac.SinSer = sc.SinSer AND ac.EmpID = sc.EmpID
WHERE trim(sc.SinConNPol) = '' AND TRIM(ac.CTR_Poliza) != '' AND TRIM(sc.SinConNPol) != TRIM(ac.CTR_Poliza)
UPDATE sc SET
    sc.SinConCom = ac.CTR_NombreCia
    FROM TESISSEG.dbo.SinCon sc
INNER JOIN TESISSEG.dbo.AS_CONTRARIOS ac
ON ac.SinConNum = sc.SinConNum AND ac.SinNumID = sc.SinNumID AND ac.SinSer = sc.SinSer AND ac.EmpID = sc.EmpID
WHERE trim(sc.SinConCom) = '' AND TRIM(ac.CTR_NombreCia) != '' AND TRIM(sc.SinConCom) != TRIM(ac.CTR_NombreCia)
UPDATE sc SET
    sc.SinConRefCom = ac.CTR_RefCia
    FROM TESISSEG.dbo.SinCon sc
INNER JOIN TESISSEG.dbo.AS_CONTRARIOS ac
ON ac.SinConNum = sc.SinConNum AND ac.SinNumID = sc.SinNumID AND ac.SinSer = sc.SinSer AND ac.EmpID = sc.EmpID
WHERE trim(sc.SinConRefCom) = '' AND TRIM(ac.CTR_RefCia) != '' AND TRIM(sc.SinConRefCom) != TRIM(ac.CTR_RefCia)
UPDATE sc SET
    sc.SinConAge = ac.CTR_Tramitador
    FROM TESISSEG.dbo.SinCon sc
INNER JOIN TESISSEG.dbo.AS_CONTRARIOS ac
ON ac.SinConNum = sc.SinConNum AND ac.SinNumID = sc.SinNumID AND ac.SinSer = sc.SinSer AND ac.EmpID = sc.EmpID
WHERE trim(sc.SinConAge) = '' AND TRIM(ac.CTR_Tramitador) != '' AND TRIM(sc.SinConAge) != TRIM(ac.CTR_Tramitador)
UPDATE sc SET
    sc.SinConDes = CAST(ac.CTR_Observaciones as VARCHAR)
    FROM TESISSEG.dbo.SinCon sc
INNER JOIN TESISSEG.dbo.AS_CONTRARIOS ac
ON ac.SinConNum = sc.SinConNum AND ac.SinNumID = sc.SinNumID AND ac.SinSer = sc.SinSer AND ac.EmpID = sc.EmpID
WHERE trim(sc.SinConDes) = '' AND TRIM(CAST(ac.CTR_Observaciones as VARCHAR)) != '' AND TRIM(sc.SinConDes) != TRIM(CAST(ac.CTR_Observaciones as VARCHAR))