Is there a way to work with records that fail to be inserted into a table?
I have a command:
insert into Table1
(select * from Table2)
but Table1 has more constraints on it, so some records will fail (this is what I want to happen). However, I would ideally like to be able to identify these records, and the constraint they failed on.
I know there is other ways of doing it, for example selecting stuff in 2 that is not in 1, but for a few different reasons this would be the best way to do it. Is it possible?
I have a command:
insert into Table1
(select * from Table2)
but Table1 has more constraints on it, so some records will fail (this is what I want to happen). However, I would ideally like to be able to identify these records, and the constraint they failed on.
I know there is other ways of doing it, for example selecting stuff in 2 that is not in 1, but for a few different reasons this would be the best way to do it. Is it possible?