Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 create table with many-to-many relationship...

Author  Topic 

a4nsd
Starting Member

20 Posts

Posted - 2006-12-05 : 07:59:26
Hi, I come back again.
Can anyone help me to create table with many-to-many relationship. Here is my three tables
tbl_Networks
(
NID int identity(1,1) primary key,
NetworkName nvarchar(256)
)

tbl_Categories
(
CID int identity(1,1) primary key,
CateName nvarchar(256),
NID int
)

tbl_Sim
(
SID int identity(1,1) primary key,
NID int,
CID int,
NameOfSim nvarchar(256)
)
My problem is 1 value in tbl_Sim may have multiple values in table tbl_Categories and vice versal. And I don't know how to organise them


So I need some help...

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-05 : 08:01:41
Remove the NID column from tbl_Categories.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

a4nsd
Starting Member

20 Posts

Posted - 2006-12-05 : 08:13:39
I already remove NID.But How To Do next...Peso..Thanks for reply
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-05 : 08:15:43
But "NameOfSim" is different for each value for tbl_Category?

Post some sample data here for each table and some thoughts about how you are going to use that data.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2006-12-05 : 08:15:43
tbl_Sim_Categories (
CID int,
SID int
)

Jay
to here knows when
Go to Top of Page

a4nsd
Starting Member

20 Posts

Posted - 2006-12-05 : 09:04:40
Thanks very much
Go to Top of Page
   

- Advertisement -