relationship/dependency for myLittleAdmin for SQL 2005

Hi,

I have and field called ID as a PK in table and ID as FK in another table, now I have created these tables how do I create a relationship/dependency between them both? I am using myLittleAdmin for SQL 2005

many thanks
LVL 12
pigmentartsAsked:
Who is Participating?
 
Chris LuttrellConnect With a Mentor Senior Database ArchitectCommented:
If myLittleAdmin gives you a query window, the code below.  I don't have your exact table and column names so I hope it is clear enough.
ALTER TABLE Table2 WITH CHECK ADD CONSTRAINT FK_Table2_Table1 FOREIGN KEY([Table1_Id])
REFERENCES Table1 ([Id])
GO
 
ALTER TABLE Table2 CHECK CONSTRAINT FK_Table2_Table1
GO

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.