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
> I created all the tables in my database (about 100 of them) a while ago
> without enforcing the RI constraints.
[quoted text clipped - 7 lines]
> Cheers,
> San.
mirof007 - 26 Jul 2006 04:31 GMT
> 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
[quoted text clipped - 4 lines]
> 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