AdventureWorks
Person.Address Table
Description
Street address information for customers, employees, and vendors.
Properties
Creation Date08/01/2010 08:40
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows19614
Data Space Used2,224.00 KB
Index Space Used2,440.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key AddressIDPrimary key for Address records.int4   
 AddressLine1First street address line.nvarchar60   
 AddressLine2Second street address line.nvarchar60  
 CityName of the city.nvarchar30   
 StateProvinceIDUnique identification number for the state or province. Foreign key to StateProvince table.int4   
 PostalCodePostal code for the street address.nvarchar15   
 rowguidROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.uniqueidentifier16 
(newid())
 
 ModifiedDateDate and time the record was last updated.datetime4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
AK_Address_rowguidUnique nonclustered index. Used to support replication samples. 
IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCodeNonclustered index. 
IX_Address_StateProvinceIDNonclustered index.  
PK_Address_AddressIDPrimary key (clustered) constraint
Relationships
RelationshipDescription
FK_Address_StateProvince_StateProvinceIDForeign key constraint referencing StateProvince.StateProvinceID.
FK_CustomerAddress_Address_AddressIDForeign key constraint referencing Address.AddressID.
FK_EmployeeAddress_Address_AddressIDForeign key constraint referencing Address.AddressID.
FK_SalesOrderHeader_Address_BillToAddressIDForeign key constraint referencing Address.AddressID.
FK_SalesOrderHeader_Address_ShipToAddressIDForeign key constraint referencing Address.AddressID.
FK_VendorAddress_Address_AddressIDForeign key constraint referencing Address.AddressID.
Objects that depend on Person.Address
 Database ObjectObject TypeDescriptionDep Level
Sales.CustomerAddress tableSales.CustomerAddressTableCross-reference table mapping customers to their address(es).1
HumanResources.EmployeeAddress tableHumanResources.EmployeeAddressTableCross-reference table mapping employees to their address(es).1
iduSalesOrderDetail triggeriduSalesOrderDetailTriggerAFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column.3
Sales.SalesOrderDetail tableSales.SalesOrderDetailTableIndividual products associated with a specific sales order. See SalesOrderHeader.2
Sales.SalesOrderHeader tableSales.SalesOrderHeaderTableGeneral sales order information.1
Sales.SalesOrderHeaderSalesReason tableSales.SalesOrderHeaderSalesReasonTableCross-reference table mapping sales orders to sales reason codes.2
uSalesOrderHeader triggeruSalesOrderHeaderTriggerAFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables.2
HumanResources.vEmployee viewHumanResources.vEmployeeViewEmployee names and addresses.1
Purchasing.VendorAddress tablePurchasing.VendorAddressTableCross-reference mapping vendors and addresses.1
Sales.vIndividualCustomer viewSales.vIndividualCustomerViewIndividual customers (names and addresses) that purchase Adventure Works Cycles products online.1
Sales.vSalesPerson viewSales.vSalesPersonViewSales representiatives (names and addresses) and their sales-related information.1
Sales.vSalesPersonSalesByFiscalYears viewSales.vSalesPersonSalesByFiscalYearsViewUses PIVOT to return aggregated sales information for each sales representative.2
Sales.vStoreWithDemographics viewSales.vStoreWithDemographicsViewStores (names and addresses) that sell Adventure Works Cycles products to consumers.1
Purchasing.vVendor viewPurchasing.vVendorViewVendor (company) names and addresses and the names of vendor employees to contact.1
Objects that Person.Address depends on
 Database ObjectObject TypeDescriptionDep Level
Person.CountryRegion tablePerson.CountryRegionTableLookup table containing the ISO standard codes for countries and regions.2
dbo.Flag datatypedbo.FlagUser Defined Data Type 2
dbo.Name datatypedbo.NameUser Defined Data Type 2
Sales.SalesTerritory tableSales.SalesTerritoryTableSales territory lookup table.2
Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.1
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [Person].[Address](
	[AddressID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
	[AddressLine1] [nvarchar](60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[AddressLine2] [nvarchar](60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[City] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[StateProvinceID] [int] NOT NULL,
	[PostalCode] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Address_AddressID] PRIMARY KEY CLUSTERED 
(
	[AddressID] 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].[Address]  WITH CHECK ADD  CONSTRAINT [FK_Address_StateProvince_StateProvinceID] FOREIGN KEY([StateProvinceID])
REFERENCES [StateProvince] ([StateProvinceID])
ALTER TABLE [Person].[Address] CHECK CONSTRAINT [FK_Address_StateProvince_StateProvinceID]
ALTER TABLE [Person].[Address] ADD  CONSTRAINT [DF_Address_rowguid]  DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Person].[Address] ADD  CONSTRAINT [DF_Address_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

Person Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.