Owner: | Sales |
Creation Date: | 04/26/2006 |
Located On: | PRIMARY |
Data Size KB: | 40 |
Index Size KB: | 120 |
Rows: | 753 |
Description: | Cross-reference table mapping stores and their employees. |
Name | Data Type | Length | NULL | Default | IsIdentity | IsGUID | Description | ||
CustomerID | int | 4 | Store identification number. Foreign key to Customer.CustomerID. | ||||||
ContactID | int | 4 | Contact (store employee) identification number. Foreign key to Contact.ContactID. | ||||||
ContactTypeID | int | 4 | Contact type such as owner or purchasing agent. Foreign key to ContactType.ContactTypeID. | ||||||
rowguid | uniqueidentifier | 16 | (newid()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||||
ModifiedDate | datetime | 8 | (getdate()) | Date and time the record was last updated. |
Index | Primary | Unique | Description | |
PK_StoreContact_CustomerID_ContactID | Primary key (clustered) constraint | |||
IX_StoreContact_ContactID | Nonclustered index. | |||
IX_StoreContact_ContactTypeID | Nonclustered index. | |||
AK_StoreContact_rowguid | Unique nonclustered index. Used to support replication samples. |
Table | Foreign Key | Primary Key or Unique Constraint | |
Person.Contact | FK_StoreContact_Contact_ContactID | PK_Contact_ContactID | |
Person.ContactType | FK_StoreContact_ContactType_ContactTypeID | PK_ContactType_ContactTypeID | |
Sales.Store | FK_StoreContact_Store_CustomerID | PK_Store_CustomerID |
Objects that [Sales].[StoreContact] depends on
Object Name | Owner | Object Type | Dep Level | |
Flag | dbo | User Defined type | 1 | |
Name | dbo | User Defined type | 1 | |
NameStyle | dbo | User Defined type | 1 | |
Phone | dbo | User Defined type | 1 | |
ufnLeadingZeros | dbo | Function | 2 | |
Contact | Person | Table | 2 | |
ContactType | Person | Table | 2 | |
SalesTerritory | Sales | Table | 2 | |
Customer | Sales | Table | 3 | |
Employee | HumanResources | Table | 3 | |
SalesPerson | Sales | Table | 4 | |
Store | Sales | Table | 5 |
Objects that depend on [Sales].[StoreContact]
Object Name | Owner | Object Type | Dep Level | |
ufnGetContactInformation | dbo | Function | 1 | |
vStoreWithDemographics | Sales | View | 1 |
CREATE TABLE [StoreContact] (
[CustomerID] [int] NOT NULL ,
[ContactID] [int] NOT NULL ,
[ContactTypeID] [int] NOT NULL ,
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT [DF_StoreContact_rowguid] DEFAULT (newid()),
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_StoreContact_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_StoreContact_CustomerID_ContactID] PRIMARY KEY CLUSTERED
(
[CustomerID],
[ContactID]
) ON [PRIMARY] ,
CONSTRAINT [FK_StoreContact_Contact_ContactID] FOREIGN KEY
(
[ContactID]
) REFERENCES [Contact] (
[ContactID]
),
CONSTRAINT [FK_StoreContact_ContactType_ContactTypeID] FOREIGN KEY
(
[ContactTypeID]
) REFERENCES [ContactType] (
[ContactTypeID]
),
CONSTRAINT [FK_StoreContact_Store_CustomerID] FOREIGN KEY
(
[CustomerID]
) REFERENCES [Store] (
[CustomerID]
)
) ON [PRIMARY]
GO
See Also
List of tables