Shashi Mannepalli wrote:
You can create the RI at what/when ever you want to.
But if the data is violating those RI rules then you will not be able
to create RI for them.
Then u need to figure out what are the RI violated ROWS and what to do
with them...ETC
cheers...
Shashi Mannepalli
Actually, in a case where you expect some of your data to viloate the
constraint, you can simply put the table into the set intergity pending
state (using the SET INTEGRITY OFF statement) prior to enabling the
enforcement of the constraint, and then subsequenlty run SET INTEGRITY
IMMEDIATE CHECKED with an exception table, that will delete all
violating rows for you and move them to the exception table.This works
for RI constraints, as well as check constraints, BTW.
Regards,
Miro