UPDATE A
SET A.OBJ_IdTesis = B.IDTSS
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, B.IDTSS
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
	INNER JOIN tssseg0001.dbo.IDTraspasos B
	ON A.OBJ_Id = B.IDTras COLLATE Modern_Spanish_CI_AI AND B.TableID = 'Clientes'
    WHERE A.ODS_TipoObjeto = 1
) B ON A.ODS_Id = B.ODS_Id

UPDATE A
SET A.OBJ_IdTesis = B.IDTSS
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, B.IDTSS
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
	INNER JOIN tssseg0001.dbo.IDTraspasos B
	ON A.OBJ_Id = B.IDTras COLLATE Modern_Spanish_CI_AI AND B.TableID = 'Colaboradores'
    WHERE A.ODS_TipoObjeto = 2
) B ON A.ODS_Id = B.ODS_Id

UPDATE A
SET A.OBJ_IdTesis = B.OBJ_Id
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, A.OBJ_Id
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
    WHERE A.ODS_TipoObjeto = 7
) B ON A.ODS_Id = B.ODS_Id

UPDATE A
SET A.OBJ_IdTesis = B.IDTSS
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, B.IDTSS
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
	INNER JOIN tssseg0001.dbo.IDTraspasos B
	ON A.OBJ_Id = B.IDTras COLLATE Modern_Spanish_CI_AI AND B.TableID = 'Recibos'
    WHERE A.ODS_TipoObjeto = 10
) B ON A.ODS_Id = B.ODS_Id

UPDATE A
SET A.OBJ_IdTesis = B.IDTSS
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, B.IDTSS
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
	INNER JOIN tssseg0001.dbo.IDTraspasos B
	ON A.OBJ_Id = B.IDTras COLLATE Modern_Spanish_CI_AI AND B.TableID = 'Siniestros'
    WHERE A.ODS_TipoObjeto = 13
) B ON A.ODS_Id = B.ODS_Id

UPDATE A
SET A.OBJ_IdTesis = B.OBJ_Id
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, A.OBJ_Id
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
    WHERE A.ODS_TipoObjeto = 1000
) B ON A.ODS_Id = B.ODS_Id

UPDATE A
SET A.OBJ_IdTesis = B.OBJ_Id
    FROM asurnet.dbo.OBJETOS_DESTACADOS A
INNER JOIN (
	SELECT A.ODS_Id, A.OBJ_Id
	FROM asurnet.dbo.OBJETOS_DESTACADOS A
    WHERE A.ODS_TipoObjeto = 160
) B ON A.ODS_Id = B.ODS_Id
