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 2005 Forums
 Transact-SQL (2005)
 How should I setup this table(s)?

Author  Topic 

Goalie35
Yak Posting Veteran

81 Posts

Posted - 2010-07-02 : 11:50:33
I need to display data about all of our sales reps onto a webpage. The problem is, we have thousands of sales reps located in a bunch of different locations and many of these locations contain different data about their reps.

For example, Branch 1 may contain a sales rep's personal phone number and their "Branch ID". Branch 2 doesn't contain personal phone number's or BranchID's. Instead of BranchID, they group their reps by what they call "Territory ID's".

So basically, I need to build some tables to create a centralized location of all rep data. Some of the fields would be obvious such as RepID, Rep First Name, Rep Last Name, etc. But how do I build the table so that branch 1 rep records also contain their "Branch ID", Branch 2 reps contain their "Territory ID", etc? There's roughly about 100 different variable categories like these across all of our sales reps & branches.

Any idea how to setup these variable fields into a clean, organized fashion?

Thanks.

denis_the_thief
Aged Yak Warrior

596 Posts

Posted - 2010-07-02 : 16:43:00
This may or may not work:

Territories
------
*TerritoryID
TerritoryName


Branches
-------
BranchID
BranchName
BranchIdentificationNumber (nullable)
TerritoryID (nullable)


SalesReps
---------
SalesRepID
BranchID
Name/info...

Go to Top of Page
   

- Advertisement -