[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

relationship/dependency for myLittleAdmin for SQL 2005

Posted on 2009-04-18
1
Medium Priority
?
369 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:pigmentarts
1 Comment
 
LVL 27

Accepted Solution

by:
Chris Luttrell earned 2000 total points
ID: 24177442
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question