AdventureWorks
Purchasing.VendorAddress Table
Description
Cross-reference mapping vendors and addresses.
Properties
Creation Date08/01/2010 08:40
File GroupPRIMARY
Text File Group
System Object
Published for Replication
Rows104
Data Space Used8.00 KB
Index Space Used24.00 KB
Columns
 Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
Primary Key VendorIDPrimary key. Foreign key to Vendor.VendorID.int4   
Primary Key AddressIDPrimary key. Foreign key to Address.AddressID.int4   
 AddressTypeIDAddress type. Foreign key to AddressType.AddressTypeID.int4   
 ModifiedDateDate and time the record was last updated.datetime4 
(getdate())
 
Indexes
IndexDescriptionPrimaryUnique
IX_VendorAddress_AddressIDNonclustered index.  
PK_VendorAddress_VendorID_AddressIDPrimary key (clustered) constraint
Relationships
RelationshipDescription
FK_VendorAddress_Address_AddressIDForeign key constraint referencing Address.AddressID.
FK_VendorAddress_AddressType_AddressTypeIDForeign key constraint referencing AddressType.AddressTypeID.
FK_VendorAddress_Vendor_VendorIDForeign key constraint referencing Vendor.VendorID.
Objects that depend on Purchasing.VendorAddress
 Database ObjectObject TypeDescriptionDep Level
Purchasing.vVendor viewPurchasing.vVendorViewVendor (company) names and addresses and the names of vendor employees to contact.1
Objects that Purchasing.VendorAddress depends on
 Database ObjectObject TypeDescriptionDep Level
dbo.AccountNumber datatypedbo.AccountNumberUser Defined Data Type 2
Person.Address tablePerson.AddressTableStreet address information for customers, employees, and vendors.1
Person.AddressType tablePerson.AddressTypeTableTypes of addresses stored in the Address table. 1
Person.CountryRegion tablePerson.CountryRegionTableLookup table containing the ISO standard codes for countries and regions.3
dbo.ErrorLog tabledbo.ErrorLogTableAudit table tracking errors in the the AdventureWorks database that are caught by the CATCH block of a TRY...CATCH construct. Data is inserted by stored procedure dbo.uspLogError when it is executed from inside the CATCH block of a TRY...CATCH construct.3
Sales.SalesTerritory tableSales.SalesTerritoryTableSales territory lookup table.3
Person.StateProvince tablePerson.StateProvinceTableState and province lookup table.2
dbo.uspLogError proceduredbo.uspLogErrorStored ProcedureLogs error information in the ErrorLog table about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without inserting error information.2
dbo.uspPrintError proceduredbo.uspPrintErrorStored ProcedurePrints error information about the error that caused execution to jump to the CATCH block of a TRY...CATCH construct. Should be executed from within the scope of a CATCH block otherwise it will return without printing any error information.2
Purchasing.Vendor tablePurchasing.VendorTableCompanies from whom Adventure Works Cycles purchases parts or other goods.1
SQL
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [Purchasing].[VendorAddress](
	[VendorID] [int] NOT NULL,
	[AddressID] [int] NOT NULL,
	[AddressTypeID] [int] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_VendorAddress_VendorID_AddressID] PRIMARY KEY CLUSTERED 
(
	[VendorID] ASC,
	[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 [Purchasing].[VendorAddress]  WITH CHECK ADD  CONSTRAINT [FK_VendorAddress_Address_AddressID] FOREIGN KEY([AddressID])
REFERENCES [Address] ([AddressID])
ALTER TABLE [Purchasing].[VendorAddress] CHECK CONSTRAINT [FK_VendorAddress_Address_AddressID]
ALTER TABLE [Purchasing].[VendorAddress]  WITH CHECK ADD  CONSTRAINT [FK_VendorAddress_AddressType_AddressTypeID] FOREIGN KEY([AddressTypeID])
REFERENCES [AddressType] ([AddressTypeID])
ALTER TABLE [Purchasing].[VendorAddress] CHECK CONSTRAINT [FK_VendorAddress_AddressType_AddressTypeID]
ALTER TABLE [Purchasing].[VendorAddress]  WITH CHECK ADD  CONSTRAINT [FK_VendorAddress_Vendor_VendorID] FOREIGN KEY([VendorID])
REFERENCES [Vendor] ([VendorID])
ALTER TABLE [Purchasing].[VendorAddress] CHECK CONSTRAINT [FK_VendorAddress_Vendor_VendorID]
ALTER TABLE [Purchasing].[VendorAddress] ADD  CONSTRAINT [DF_VendorAddress_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
See Also

Related Objects

Purchasing Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.