Description
Cross-reference table mapping stores, vendors, and employees to people
Table properties
| name | value |
|---|
| name | [Person].[BusinessEntityContact] |
| created | Mar 19 2009 9:09PM |
| modified | Mar 19 2009 9:10PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 909 |
| Size of data | 48 kb |
| Size of indexes | 128 kb |
| Maximum size of a single row | 36 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| BusinessEntityID | int | 10 | 4 | | no
| composite PK
| BusinessEntity.BusinessEntityID
|
| no
| Primary key. Foreign key to BusinessEntity.BusinessEntityID.
|
| PersonID | int | 10 | 4 | | no
| composite PK
| Person.BusinessEntityID
|
| no
| Primary key. Foreign key to Person.BusinessEntityID.
|
| ContactTypeID | int | 10 | 4 | | no
| composite PK
| ContactType.ContactTypeID
|
| no
| Primary key. Foreign key to ContactType.ContactTypeID.
|
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no
|
| |
| no
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_BusinessEntityContact_BusinessEntity_BusinessEntityID | BusinessEntityID | BusinessEntity.BusinessEntityID |
| Foreign key constraint referencing BusinessEntity.BusinessEntityID.
|
| FK_BusinessEntityContact_Person_PersonID | PersonID | Person.BusinessEntityID |
| Foreign key constraint referencing Person.BusinessEntityID.
|
| FK_BusinessEntityContact_ContactType_ContactTypeID | ContactTypeID | ContactType.ContactTypeID |
| Foreign key constraint referencing ContactType.ContactTypeID.
|
Defaults
Dependency graph
Objects that depend on [Person].[BusinessEntityContact]
Sample rows
| BusinessEntityID | PersonID | ContactTypeID | rowguid | ModifiedDate |
|---|
| 292
| 291
| 11
| 7d4d2dbc-4a44-48f5-911d-a63abafd5120
| 1/14/2008 1:21:02 PM
|
| 294
| 293
| 11
| 3ea25b65-9579-4260-977d-d6f00d7d20ee
| 1/14/2008 1:21:02 PM
|
| 296
| 295
| 11
| dadac1ff-3351-4827-9ae0-95004885c193
| 1/14/2008 1:21:02 PM
|
| 298
| 297
| 11
| b924f26f-6446-45d1-a92b-6f418374f075
| 1/14/2008 1:21:02 PM
|
| 300
| 299
| 11
| 5ba4e7be-8d29-46a2-b68d-67b1615b124a
| 1/14/2008 1:21:02 PM
|
| 302
| 301
| 11
| 6cc8f248-8d96-4afd-adcc-61d93e8de3b1
| 1/14/2008 1:21:02 PM
|
| 304
| 303
| 11
| 33b4da81-4448-481f-bf7c-357ea4d23f21
| 1/14/2008 1:21:02 PM
|
| 306
| 305
| 11
| 70d35526-7c2f-470f-98cb-f9299a754f16
| 1/14/2008 1:21:02 PM
|
| 308
| 307
| 14
| da33b75d-32fb-432d-a275-9e9d32e78f3e
| 1/14/2008 1:21:02 PM
|
| 310
| 309
| 14
| c2dee145-a902-477e-ab21-29659ac3e97e
| 1/14/2008 1:21:02 PM
|
Code
CREATE TABLE [Person].[BusinessEntityContact](
[BusinessEntityID] [int] NOT NULL,
[PersonID] [int] NOT NULL,
[ContactTypeID] [int] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[BusinessEntityID] [int] NOT NULL,
[PersonID] [int] NOT NULL,
[ContactTypeID] [int] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_BusinessEntityContact_BusinessEntityID_PersonID_ContactTypeID] PRIMARY KEY CLUSTERED
(
[BusinessEntityID] ASC,
[PersonID] ASC,
[ContactTypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [Person].[BusinessEntityContact] WITH CHECK ADD CONSTRAINT [FK_BusinessEntityContact_BusinessEntity_BusinessEntityID] FOREIGN KEY([BusinessEntityID])
REFERENCES [Person].[BusinessEntity] ([BusinessEntityID])
ALTER TABLE [Person].[BusinessEntityContact] CHECK CONSTRAINT [FK_BusinessEntityContact_BusinessEntity_BusinessEntityID]
ALTER TABLE [Person].[BusinessEntityContact] WITH CHECK ADD CONSTRAINT [FK_BusinessEntityContact_ContactType_ContactTypeID] FOREIGN KEY([ContactTypeID])
REFERENCES [Person].[ContactType] ([ContactTypeID])
ALTER TABLE [Person].[BusinessEntityContact] CHECK CONSTRAINT [FK_BusinessEntityContact_ContactType_ContactTypeID]
ALTER TABLE [Person].[BusinessEntityContact] WITH CHECK ADD CONSTRAINT [FK_BusinessEntityContact_Person_PersonID] FOREIGN KEY([PersonID])
REFERENCES [Person].[Person] ([BusinessEntityID])
ALTER TABLE [Person].[BusinessEntityContact] CHECK CONSTRAINT [FK_BusinessEntityContact_Person_PersonID]
ALTER TABLE [Person].[BusinessEntityContact] ADD CONSTRAINT [DF_BusinessEntityContact_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Person].[BusinessEntityContact] ADD CONSTRAINT [DF_BusinessEntityContact_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]