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
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 One to Many or Many to Many

Author  Topic 

rama108
Posting Yak Master

115 Posts

Posted - 2015-04-27 : 15:26:02
Hello,
Need to create a cross-reference between stores and manufacturer tables. Should it be 1 to many or many to many, any ideas?

Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-27 : 15:36:47
Need more info.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

rama108
Posting Yak Master

115 Posts

Posted - 2015-04-27 : 17:05:16
Imagine there are 2 tables, 1 is stores and 2nd is manufacturers. I need to create a cross-reference between these two tables. Stores should be able to reference manufacturers table and manufacturers table should be able to reference stores table.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2015-04-27 : 20:48:45
Stores table has, say, StoreID, Store Name, Store Address, Store Phone Number

Manufacturers table has, say, ManufacturerID, Name, Address, Phone Number, Discount

Store Manufacturer X-Reference table just has StoreID, ManufacturerID
Go to Top of Page

rama108
Posting Yak Master

115 Posts

Posted - 2015-04-28 : 15:03:20
Hello Kristen,
Such simple solution and still could not think. Thank you.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2015-04-28 : 16:55:55
Glad it helped

You might want to include a Sequence No in the X-Reference table - so that you can have "Preferred ManufacturerID for a given store, and "alternative" ManufacturerIDs
Go to Top of Page
   

- Advertisement -