create relationships between two tables without referential integrity

Y

Yor

Hi, I want to create a relationship between tables A and B without
referential integrity using the "Microsoft Jet SQL" to create the structure
with a script. When I create with the following sentences:
ALTER TABLE [TablaB] ADD
CONSTRAINT [RL_TablaB_IDA] ([IDA]) REFERENCES [TablaA] ([ID]);

It create the relationship with the referential integrity.

How Can I create the relationship without referential integrity using the
Microsoft Jet SQL?

Thanks
 
T

Tim Ferguson

How Can I create the relationship without referential integrity using the
Microsoft Jet SQL?

This seems awfully familiar...

There is no relationship without referential integrity. Relationships exist
in order to protect the integrity of the data.

Access confuses things a little bit by allowing the user to draw a line in
the relationships window without making a relationship -- but it has no
effect on the data model and is simply stored in the GUI as a kind of hint
for later. There is no SQL for it because SQL does not know anything about
user interfaces: it only cares about data.

So why on earth would you want to make a relationship without enforcing it
anyway?

Tim F
 
R

roger

You can create a relationship without referential
integrity also...just when you make the relationship do
not check the ref intergrity check box and you will have a
1-1,1-m et c relationships.

Yes you can have relationships without RI and that is good
also because RI can be very limiting at times.
 
T

Tim Ferguson

You can create a relationship without referential
integrity also...just when you make the relationship do
not check the ref intergrity check box and you will have a
1-1,1-m et c relationships.

The OP was asking about doing it in SQL -- and the answer is no.
Yes you can have relationships without RI and that is good
also because RI can be very limiting at times.

No: not limiting, but constraining. Which is exactly the point, and I
really don't see what good it is to draw a line in the relationships window
if it is not a relationship. Get this -- relationships are there to control
what can be inserted and deleted from a database. You can't be a little bit
pregnant, and your data can't be a little bit protected. Either you have a
rule that says you can have an order line that belongs to a non existent
order, or you don't. No half-way house, no fudge; either it's okay or it's
not okay. To me this is simple, O-level R theory, and it still amazes me
that people who are intelligent enough to switch on their computer think
that they can programme it to say, "here's a rule but you don't always have
to keep it..."

Frustrated.


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top