# Table: Vendor

## Properties

Property | Value
--- | ---
Name | Vendor
ID | 510624862
Owner | dbo
Schema | Purchasing
Filegroup | PRIMARY
Data Size (KB) | 16 KB
Index Size (KB) | 32 KB
Rows | 104
Unused (KB) | 0 KB
ANSI Null On |
Quoted Identifier |
Lock Escalation | TABLE
Lock On Bulk Load |
Lob Data Space |
Filestream Data Space ID |
Has Unchecked Assembly Data |
Text In Row Limit (bytes) | Option not set
Large Value Types Out Of Row |
FullText Change Tracking On |
Tracked By Cdc |
Published |
Schema Published |
Replicated |
Replication Filter |
Merge Published |
Sync Tran Subscribed |
MS Shipped |
Modify Date | 8/8/2010 5:23:44 PM
Create Date | 8/8/2010 5:21:54 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Companies from whom Adventure Works Cycles purchases parts or other goods.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | BusinessEntityID | int |  |  |
2 | AccountNumber | AccountNumber |  |  |
3 | Name | Name |  |  |
4 | CreditRating | tinyint |  |  |
5 | PreferredVendorStatus | Flag |  |  |
6 | ActiveFlag | Flag |  |  |
7 | PurchasingWebServiceURL | nvarchar(1024) |  |  |
8 | ModifiedDate | datetime |  |  |

## Identity Columns

No identity columns defined.

## Primary Key Constraints

Name | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | ---
PK_Vendor_BusinessEntityID |  | MS_Description | Primary key (clustered) constraint

## Primary Key Columns

Name
BusinessEntityID

## Foreign Keys

Name | Referenced Object | Update Action | Delete Action
--- | --- | --- | ---
FK_Vendor_BusinessEntity_BusinessEntityID | Person.BusinessEntity | No action | No action

## Column Level Check Constraints

Name | Column ID | Column | Definition | Is Disabled | Is Not For Replication | Is Not Trusted | Uses Database Collation | Is System Named
--- | --- | --- | --- | --- | --- | --- | --- | ---
CK_Vendor_CreditRating | 4 | CreditRating | ([CreditRating]>=(1) AND [CreditRating]<=(5)) |  |  |  |  |

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_Vendor_PreferredVendorStatus | PreferredVendorStatus | ((1)) |  | MS_Description | Default constraint value of 1 (TRUE)
DF_Vendor_ActiveFlag | ActiveFlag | ((1)) |  | MS_Description | Default constraint value of 1 (TRUE)
DF_Vendor_ModifiedDate | ModifiedDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_Vendor_BusinessEntityID | CLUSTERED |  |  |  |  |
AK_Vendor_AccountNumber | NONCLUSTERED |  |  |  |  |

## FullText Indexes

No fulltext indexes defined.

## Referencing Tables

Name | Key Index ID | Is Disabled | Is Not For Replication | Is Not Trusted | Delete Action | Update Action | Is System Named | Referencing Object
--- | --- | --- | --- | --- | --- | --- | --- | ---
FK_ProductVendor_Vendor_BusinessEntityID | 1 |  |  |  | No action | No action |  | Purchasing.ProductVendor
FK_PurchaseOrderHeader_Vendor_VendorID | 1 |  |  |  | No action | No action |  | Purchasing.PurchaseOrderHeader

## Object Level Permissions

No object level permissions defined.

## Column Level Permissions

No explicit column permissions granted to this object

## Statistics

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
PK_Vendor_BusinessEntityID | Aug 8 2010 5:23PM | 104 | 104 | 53 | 1 | 4 |  |  | 104

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.009615385 | 4 | BusinessEntityID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
1492 | 0 | 1 | 0 | 1
1496 | 1 | 1 | 1 | 1
1500 | 1 | 1 | 1 | 1
1504 | 1 | 1 | 1 | 1
1508 | 1 | 1 | 1 | 1
1512 | 1 | 1 | 1 | 1
1516 | 1 | 1 | 1 | 1
1520 | 1 | 1 | 1 | 1
1524 | 1 | 1 | 1 | 1
1528 | 1 | 1 | 1 | 1
1532 | 1 | 1 | 1 | 1
1536 | 1 | 1 | 1 | 1
1540 | 1 | 1 | 1 | 1
1544 | 1 | 1 | 1 | 1
1548 | 1 | 1 | 1 | 1
1552 | 1 | 1 | 1 | 1
1556 | 1 | 1 | 1 | 1
1560 | 1 | 1 | 1 | 1
1564 | 1 | 1 | 1 | 1
1568 | 1 | 1 | 1 | 1
1572 | 1 | 1 | 1 | 1
1576 | 1 | 1 | 1 | 1
1580 | 1 | 1 | 1 | 1
1584 | 1 | 1 | 1 | 1
1588 | 1 | 1 | 1 | 1
1592 | 1 | 1 | 1 | 1
1596 | 1 | 1 | 1 | 1
1600 | 1 | 1 | 1 | 1
1604 | 1 | 1 | 1 | 1
1608 | 1 | 1 | 1 | 1
1612 | 1 | 1 | 1 | 1
1616 | 1 | 1 | 1 | 1
1620 | 1 | 1 | 1 | 1
1624 | 1 | 1 | 1 | 1
1628 | 1 | 1 | 1 | 1
1632 | 1 | 1 | 1 | 1
1636 | 1 | 1 | 1 | 1
1640 | 1 | 1 | 1 | 1
1644 | 1 | 1 | 1 | 1
1648 | 1 | 1 | 1 | 1
1652 | 1 | 1 | 1 | 1
1656 | 1 | 1 | 1 | 1
1660 | 1 | 1 | 1 | 1
1664 | 1 | 1 | 1 | 1
1668 | 1 | 1 | 1 | 1
1672 | 1 | 1 | 1 | 1
1676 | 1 | 1 | 1 | 1
1680 | 1 | 1 | 1 | 1
1684 | 1 | 1 | 1 | 1
1688 | 1 | 1 | 1 | 1
1692 | 1 | 1 | 1 | 1
1696 | 1 | 1 | 1 | 1
1698 | 0 | 1 | 0 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
AK_Vendor_AccountNumber | Aug 8 2010 5:23PM | 104 | 104 | 102 | 1 | 26.48077 |  |  | 104

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.009615385 | 22.48077 | AccountNumber
0.009615385 | 26.48077 | AccountNumber, BusinessEntityID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
ADATUM0001 | 0 | 1 | 0 | 1
ADVANCED0001 | 0 | 1 | 0 | 1
ALLENSON0001 | 0 | 1 | 0 | 1
AMERICAN0001 | 0 | 1 | 0 | 1
AMERICAN0002 | 0 | 1 | 0 | 1
ANDERSON0001 | 0 | 1 | 0 | 1
AURORAB0001 | 0 | 1 | 0 | 1
AUSTRALI0001 | 0 | 1 | 0 | 1
BEAUMONT0001 | 0 | 1 | 0 | 1
BERGERON0001 | 0 | 1 | 0 | 1
BICYCLE0001 | 0 | 1 | 0 | 1
BIKESAT0001 | 0 | 1 | 0 | 1
BLOOMING0001 | 0 | 1 | 0 | 1
BURNETT0001 | 0 | 1 | 0 | 1
BUSINESS0001 | 0 | 1 | 0 | 1
CAPITAL0001 | 0 | 1 | 0 | 1
CARLSON0001 | 0 | 1 | 0 | 1
CHICAGO0001 | 0 | 1 | 0 | 1
CHICAGO0002 | 0 | 1 | 0 | 1
CIRCUIT0001 | 0 | 1 | 0 | 1
COMFORT0001 | 0 | 1 | 0 | 1
COMPETE0001 | 0 | 1 | 0 | 1
COMPETE0002 | 0 | 1 | 0 | 1
COMPETIT0001 | 0 | 1 | 0 | 1
CONSUMER0001 | 0 | 1 | 0 | 1
CONTINEN0001 | 0 | 1 | 0 | 1
CROWLEY0001 | 0 | 1 | 0 | 1
CRUGERB0001 | 0 | 1 | 0 | 1
CUSTOMF0001 | 0 | 1 | 0 | 1
CYCLING0001 | 0 | 1 | 0 | 1
ELECTRON0001 | 0 | 1 | 0 | 1
ELECTRON0002 | 0 | 1 | 0 | 1
EXPERTB0001 | 0 | 1 | 0 | 1
FEDERAL0001 | 0 | 1 | 0 | 1
FIRSTNA0001 | 0 | 1 | 0 | 1
FIRSTRA0001 | 0 | 1 | 0 | 1
FITNESS0001 | 0 | 1 | 0 | 1
G&KBI0001 | 0 | 1 | 0 | 1
GARDNER0001 | 0 | 1 | 0 | 1
GMASKI0001 | 0 | 1 | 0 | 1
GREENLA0001 | 0 | 1 | 0 | 1
GREENWOO0001 | 0 | 1 | 0 | 1
HILLBIC0001 | 0 | 1 | 0 | 1
HILLSBI0001 | 0 | 1 | 0 | 1
HOLIDAY0001 | 0 | 1 | 0 | 1
HYBRIDB0001 | 0 | 1 | 0 | 1
ILLINOIS0001 | 0 | 1 | 0 | 1
IMAGEMA0001 | 0 | 1 | 0 | 1
INDIANA0001 | 0 | 1 | 0 | 1
INNERCI0001 | 1 | 1 | 1 | 1
INTEGRAT0001 | 0 | 1 | 0 | 1
INTERNAT0001 | 0 | 1 | 0 | 1
INTERNAT0003 | 1 | 1 | 1 | 1
INTERNAT0004 | 0 | 1 | 0 | 1
JACKSON0001 | 0 | 1 | 0 | 1
JEFFSSP0001 | 0 | 1 | 0 | 1
KNOPFLER0001 | 0 | 1 | 0 | 1
LAKEWOOD0001 | 0 | 1 | 0 | 1
LEAFRIV0001 | 0 | 1 | 0 | 1
LEGENDC0001 | 0 | 1 | 0 | 1
LIGHTSP0001 | 0 | 1 | 0 | 1
LINDELL0001 | 0 | 1 | 0 | 1
LITWARE0001 | 0 | 1 | 0 | 1
MAGICCY0001 | 0 | 1 | 0 | 1
MARSH0001 | 0 | 1 | 0 | 1
MERITBI0001 | 0 | 1 | 0 | 1
METROSP0001 | 0 | 1 | 0 | 1
MIDWEST0001 | 0 | 1 | 0 | 1
MITCHELL0001 | 0 | 1 | 0 | 1
MORGANB0001 | 0 | 1 | 0 | 1
MOUNTAIN0001 | 0 | 1 | 0 | 1
NATIONAL0001 | 0 | 1 | 0 | 1
NORSTAN0001 | 0 | 1 | 0 | 1
NORTHERN0001 | 0 | 1 | 0 | 1
NORTHW0001 | 0 | 1 | 0 | 1
PREMIER0001 | 0 | 1 | 0 | 1
PROFESSI0001 | 0 | 1 | 0 | 1
PROSE0001 | 0 | 1 | 0 | 1
PROSPOR0001 | 0 | 1 | 0 | 1
READYRE0001 | 0 | 1 | 0 | 1
RECREATI0001 | 0 | 1 | 0 | 1
RELIANCE0001 | 0 | 1 | 0 | 1
SIGNATUR0001 | 0 | 1 | 0 | 1
SPEEDCO0001 | 0 | 1 | 0 | 1
SPORTFA0001 | 0 | 1 | 0 | 1
SPORTPL0001 | 0 | 1 | 0 | 1
SPORTSH0001 | 0 | 1 | 0 | 1
SUPERIOR0001 | 0 | 1 | 0 | 1
SUPERSAL0001 | 0 | 1 | 0 | 1
TEAMATH0001 | 0 | 1 | 0 | 1
TOURING0001 | 0 | 1 | 0 | 1
TRAINING0001 | 0 | 1 | 0 | 1
TREYRE0001 | 0 | 1 | 0 | 1
TRIKES0001 | 0 | 1 | 0 | 1
VARSITY0001 | 0 | 1 | 0 | 1
VICTORY0001 | 0 | 1 | 0 | 1
VISIONC0001 | 0 | 1 | 0 | 1
VISTARO0001 | 0 | 1 | 0 | 1
WESTAMER0001 | 0 | 1 | 0 | 1
WESTJUN0001 | 0 | 1 | 0 | 1
WIDEWOR0001 | 0 | 1 | 0 | 1
WOODFIT0001 | 0 | 1 | 0 | 1

## Objects that depend on [Vendor]

- Purchasing.Vendor
  - dbo.ufnGetContactInformation
  - Purchasing.dVendor
  - Purchasing.ProductVendor
  - Purchasing.PurchaseOrderHeader
    - Purchasing.PurchaseOrderDetail
      - Purchasing.iPurchaseOrderDetail
      - Purchasing.uPurchaseOrderDetail
    - Purchasing.uPurchaseOrderHeader
  - Purchasing.vVendorWithAddresses
  - Purchasing.vVendorWithContacts

## Objects on which [Vendor] depends

- Purchasing.Vendor
  - dbo.uspLogError
    - dbo.uspPrintError
    - dbo.ErrorLog
  - dbo.AccountNumber
  - Person.BusinessEntity
  - dbo.Flag
  - dbo.Name

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [Purchasing].[Vendor]( [BusinessEntityID] [int] NOT NULL, [AccountNumber] [dbo].[AccountNumber] NOT NULL, [Name] [dbo].[Name] NOT NULL, [CreditRating] [tinyint] NOT NULL, [PreferredVendorStatus] [dbo].[Flag] NOT NULL, [ActiveFlag] [dbo].[Flag] NOT NULL, [PurchasingWebServiceURL] [nvarchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ModifiedDate] [datetime] NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'BusinessEntityID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Vendor account (identification) number.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'AccountNumber' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Company name.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'Name' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'CreditRating' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'PreferredVendorStatus' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 = Vendor no longer used. 1 = Vendor is actively used.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'ActiveFlag' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Vendor URL.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'PurchasingWebServiceURL' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time the record was last updated.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor', @level2type=N'COLUMN',@level2name=N'ModifiedDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Companies from whom Adventure Works Cycles purchases parts or other goods.' , @level0type=N'SCHEMA',@level0name=N'Purchasing', @level1type=N'TABLE',@level1name=N'Vendor'

#### See also

List of Tables