Database reference - AdventureWorks

AdventureWorks -  tables -  [Person].[ContactType]

Description

Lookup table containing the types of contacts stored in Contact. 

Table properties

namevalue
name[Person].[ContactType]
createdMar 19 2009 9:08PM
modifiedMar 19 2009 9:08PM 
ansi nullson 
quoted identifieron 
row count20
Size of data8 kb
Size of indexes24 kb
Maximum size of a single row212 bytes

Columns

columndatatypelengthbytesdefaultnullsPKFKUQcomputedcomment
ContactTypeIDint identity(1,1)104 no  yes    no  Primary key for ContactType records. 
NameName50200 no      no  Contact type description. 
ModifiedDatedatetime238(getdate())no      no  Date and time the record was last updated. 

Indexes

namedescriptioncolumncomment
AK_ContactType_Namenonclustered, unique located on PRIMARYNameUnique nonclustered index. 
PK_ContactType_ContactTypeIDclustered, unique, primary key located on PRIMARYContactTypeIDClustered index created by a primary key constraint. 

Referenced by

name
VendorContact
StoreContact

Foreign key graph

ContactTypeVendorContactStoreContact

Defaults

default namecolumncomment
DF_ContactType_ModifiedDateModifiedDateDefault constraint value of GETDATE() 

Dependency graph

DF_ContactType_ModifiedDateNameContactTypeAK_ContactType_NamePK_ContactType_ContactTypeID...ufnGetContactInformationvVendorvStoreWithDemographics

Objects that [Person].[ContactType] depends on

nameobject typelevel
Nametype1

Objects that depend on [Person].[ContactType]

nameobject typelevel
ufnGetContactInformationmulti-statement table valued function1
vVendorview1
vStoreWithDemographicsview1

Sample rows

ContactTypeIDNameModifiedDate
Accounting Manager  6/1/1998 12:00:00 AM 
Assistant Sales Agent  6/1/1998 12:00:00 AM 
Assistant Sales Representative  6/1/1998 12:00:00 AM 
Coordinator Foreign Markets  6/1/1998 12:00:00 AM 
Export Administrator  6/1/1998 12:00:00 AM 
International Marketing Manager  6/1/1998 12:00:00 AM 
Marketing Assistant  6/1/1998 12:00:00 AM 
Marketing Manager  6/1/1998 12:00:00 AM 
Marketing Representative  6/1/1998 12:00:00 AM 
10  Order Administrator  6/1/1998 12:00:00 AM 

Code

CREATE TABLE [Person].[ContactType](
    [ContactTypeID] [int] IDENTITY(1,1) NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [ContactTypeID] [int] IDENTITY(1,1) NOT NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_ContactType_ContactTypeID] PRIMARY KEY CLUSTERED 
(
    [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].[ContactType] ADD  CONSTRAINT [DF_ContactType_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]

Powered by Yoyodyne © 1971