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
 SQL Table

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2011-10-18 : 07:46:38
Hi,

I am in the process of creating my ER diagram, and have a slight problem in the logic below;

I have a table called

TblContacts - ContactName, ContactEmail, ContactPhone

Now, I have Contact Reason 1 and Contact Reason 2.

Contact Reason 1
- General
- Sales
- Customer Service

Contact Reason 2
- Trials
- Safety
- Studies

The problem I am facing is formulating how I'll link the data with the TblContacts. Will I require another table? Looks ups?

N/B: A contact name can have more than 1 Contact Reason 1 or Contact Reason 2 at any one time. Also a contact name can option to select a Contact Reason 1 and a Contact Reason 2. So there is this 1 to many relationship..

Any suggestions?

Thank you



visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-18 : 08:19:19
better to have a new table linking contract reason and TblContacts. it should have ContactID (id column of TblContacts) and Contact Reason 1 id and Contact Reason 2 id. the contract reasons can be stored on separate table contactreasons containing ContactReasonid,ContactReason


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -