Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/03/2017, 14:45
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: Si no existe no insertar

si haciendo un select con un left join digamos que quieres insertar lo de tabla1 que no esta en tabla2

Código SQL:
Ver original
  1. INSERT INTO tabla2
  2. SELECT * FROM tabla1 AS t1 LEFT JOIN tabla2 AS t2 ON (t1.id0t2.id)
  3. WHERE t2.id IS NOT NULL
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me