Properties

Owner: Purchasing 
Creation Date: 04/26/2006 
Located On: PRIMARY 
Data Size KB: 16 
Index Size KB: 32 
Rows: 104 
Description: Companies from whom Adventure Works Cycles purchases parts or other goods. 

Columns

Name Data Type Length NULL Default IsIdentity IsGUID Description
    VendorID  int          Primary key for Vendor records. 
    AccountNumber  AccountNumber  30          Vendor account (identification) number. 
    Name  Name  100          Company name. 
    CreditRating  tinyint          1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average 
    PreferredVendorStatus  Flag    ((1))      0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product. 
    ActiveFlag  Flag    ((1))      0 = Vendor no longer used. 1 = Vendor is actively used. 
    PurchasingWebServiceURL  nvarchar  1024          Vendor URL. 
    ModifiedDate  datetime    (getdate())      Date and time the record was last updated. 
Total: 8 column(s)

Identity column

Name Seed Increment Not for replication
  VendorID   

Indexes

Index Primary Unique Description
  PK_Vendor_VendorID      Primary key (clustered) constraint 
  AK_Vendor_AccountNumber      Unique nonclustered index. 
Total: 2 index(es)

Triggers

Name Owner Instead Of Disabled Table/View Description
  dVendor  Purchasing      Purchasing.Vendor  INSTEAD OF DELETE trigger which keeps Vendors from being deleted. 
Total: 1 trigger(s)

Check Constraints

Name Expression
  CK_Vendor_CreditRating  ([CreditRating]>=(1) AND [CreditRating]<=(5)) 
Total: 1 constraint(s)

Referencing Tables

Table Foreign Key Primary Key or Unique Constraint
  Purchasing.ProductVendor  FK_ProductVendor_Vendor_VendorID  PK_Vendor_VendorID 
  Purchasing.PurchaseOrderHeader  FK_PurchaseOrderHeader_Vendor_VendorID  PK_Vendor_VendorID 
  Purchasing.VendorAddress  FK_VendorAddress_Vendor_VendorID  PK_Vendor_VendorID 
  Purchasing.VendorContact  FK_VendorContact_Vendor_VendorID  PK_Vendor_VendorID 
Total: 4 table(s)

Objects that [Purchasing].[Vendor] depends on

Object Name Owner Object Type Dep Level
  AccountNumber  dbo  User Defined type 
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
Total: 3 object(s)

Objects that depend on [Purchasing].[Vendor]

Object Name Owner Object Type Dep Level
  ProductVendor  Purchasing  Table 
  PurchaseOrderHeader  Purchasing  Table 
  VendorAddress  Purchasing  Table 
  VendorContact  Purchasing  Table 
  dVendor  Purchasing  Trigger 
  ufnGetContactInformation  dbo  Function 
  vVendor  Purchasing  View 
  PurchaseOrderDetail  Purchasing  Table 
  uPurchaseOrderHeader  Purchasing  Trigger 
  iPurchaseOrderDetail  Purchasing  Trigger 
  uPurchaseOrderDetail  Purchasing  Trigger 
Total: 11 object(s)

SQL

CREATE TABLE [Vendor] (
    [VendorID] [int] IDENTITY (1, 1) NOT NULL ,
    [AccountNumber] [AccountNumber] NOT NULL ,
    [Name] [Name] NOT NULL ,
    [CreditRating] [tinyint] NOT NULL ,
    [PreferredVendorStatus] [Flag] NOT NULL CONSTRAINT [DF_Vendor_PreferredVendorStatus] DEFAULT ((1)),
    [ActiveFlag] [Flag] NOT NULL CONSTRAINT [DF_Vendor_ActiveFlag] DEFAULT ((1)),
    [PurchasingWebServiceURL] [nvarchar] (1024) COLLATE Latin1_General_CS_AS NULL ,
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_Vendor_ModifiedDate] DEFAULT (getdate()),
    CONSTRAINT [PK_Vendor_VendorID] PRIMARY KEY  CLUSTERED
    (
        [VendorID]
    )  ON [PRIMARY] ,
    CONSTRAINT [CK_Vendor_CreditRating] CHECK ([CreditRating]>=(1) AND [CreditRating]<=(5))
) ON [PRIMARY]
GO


See Also

List of tables