Properties

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. 

Columns

Name Data Type Length NULL Default IsIdentity IsGUID Description
    CustomerID  int          Store identification number. Foreign key to Customer.CustomerID. 
    ContactID  int          Contact (store employee) identification number. Foreign key to Contact.ContactID. 
    ContactTypeID  int          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    (getdate())      Date and time the record was last updated. 
Total: 5 column(s)

Indexes

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. 
Total: 4 index(es)

Referenced Tables

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 
Total: 3 table(s)

Objects that [Sales].[StoreContact] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  NameStyle  dbo  User Defined type 
  Phone  dbo  User Defined type 
  ufnLeadingZeros  dbo  Function 
  Contact  Person  Table 
  ContactType  Person  Table 
  SalesTerritory  Sales  Table 
  Customer  Sales  Table 
  Employee  HumanResources  Table 
  SalesPerson  Sales  Table 
  Store  Sales  Table 
Total: 12 object(s)

Objects that depend on [Sales].[StoreContact]

Object Name Owner Object Type Dep Level
  ufnGetContactInformation  dbo  Function 
  vStoreWithDemographics  Sales  View 
Total: 2 object(s)

SQL

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