Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/10/2012, 13:48
gus_anomaly
 
Fecha de Ingreso: noviembre-2009
Mensajes: 381
Antigüedad: 14 años, 6 meses
Puntos: 6
Respuesta: Pasar datos de una tabla a otra sin ID

Mi estimado, ante todo muchisimas gacias por responder, aqui tengo el siguiente error:


Explicit value must be specified for identity column in table 'my_table' either when IDENTITY_INSERT is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.

Mi query quedo asi:

Código SQL:
Ver original
  1. SET IDENTITY_INSERT table_2 ON
  2.  
  3. INSERT INTO table_2 (campo1, campo2, campo3, campo4)
  4.  
  5. SELECT campo1, campo2, campo3, campo4 FROM table_1
  6.      
  7. SET IDENTITY_INSERT table_2 OFF

En ambos caso ignore los Ids.

Última edición por gus_anomaly; 29/10/2012 a las 13:58