I have a Microsoft Access database and I have two tables. Table1 has a primary key and Table2 has a foreign key that references Table1's primary key. This relationship is set up and viewable in the Relationship viewer in MS Access, the 'Enforce Referential Integrity' check box is checked, and the Join type is an inner join. The relationship is:
[Table1]--1---------N--[Table2]
I need to be able to 'DROP' this relationship/constraint via SQL. How do I do this? I have no name for this relationship/constraint as it was set up in Access manually, not with SQL. Is there a way to do what I need to do?
Determine the relationship using
SELECT szRelationship FROM Msysrelationships WHERE szObject = 'childtablename' and szReferencedObject = 'parenttablename'
THEN
Use the ALTER TABLE command. Something along the line of this
ALTER TABLE Table2 DROP CONSTRAINT Relation1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With