DELETE FROM asurnet.dbo.GLCEJE

INSERT INTO asurnet.dbo.GLCEJE
SELECT A.GCL_Id, B.IDTSS
FROM vsegbas.dbo.GRUPOSDECLIENTES A
INNER JOIN tssseg0001.dbo.IDTraspasos B ON A.EJE_ID = B.IdTras AND B.TableID = 'Ejecutivos'
WHERE A.EJE_ID IS NOT NULL