Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Referencial Integrity
Wed, Apr 30 2008 5:48 PMPermanent Link

"Jose Eduardo Helminsky"
I have a database with almost 100 tables and I am trying to create the
database with one script. The tables are being created in alphabetic order
and therefore some RI constraints will reference tables that does not exists
yet.

How can I avoid this situation ? Create the database without RI and after
that call the RI scripts altering the database ?

I would like some opinions.

Eduardo

Wed, Apr 30 2008 7:58 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Eduardo,

The approach that I have generally seen (and therefore use myself) is to
create all tables, indexes and table/data validation rules, then finally
create other constraints (such as RI). Following this method, you can still
create the tables in alpha order (which makes sense from a code maintenance
POV) and then apply constraints when all required tables exist.

HTH
--

Best Regards

Steve
[Team Elevate]

"Jose Eduardo Helminsky" <contato@hpro.com.br> wrote in message
news:3A0D6817-BD5C-475D-AF8A-65DC6340B17C@news.elevatesoft.com...
>I have a database with almost 100 tables and I am trying to create the
>database with one script. The tables are being created in alphabetic order
>and therefore some RI constraints will reference tables that does not
>exists yet.
>
> How can I avoid this situation ? Create the database without RI and after
> that call the RI scripts altering the database ?
>
> I would like some opinions.
>
> Eduardo
>
>

Image