SQL Server 2005: Creating a relationship between two tables

  • Thread starter Thread starter weird0
  • Start date Start date
W

weird0

How can i create a relationship between two tables 1:1 or 1:M in Sql
Server 2005. I guess i can alternatively take a join of the tables
and perform the work.

Can anyone tell me the steps after simply:

Add Component-> Add SQL Database. Then i created the tables with their
respective properties.

Now what is next that i shud do ? Please refer some good tutorials
anyway?
 
Weird,

Just open a reference box (right clicking) on the child modify box.
Name your technical ID ID and in the child table give that the name parentID
and than the only thing you have to do is to fill that box

PartentTable.......................ChildTable
ID.......................................parentTableID

of course the real names and keys of the tables

That should be all.

(Sorry to all, not real a C# answer)

Alternatively you van use a join

Or you can make it Net by a relation in your program or using a
dataview.rowfilter or datatable.select to filter the ID.

Cor
 

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

Back
Top