Description
Companies from whom Adventure Works Cycles purchases parts or other goods.
Table properties
| name | value |
|---|
| name | [Purchasing].[Vendor] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 104 |
| Size of data | 16 kb |
| Size of indexes | 32 kb |
| Maximum size of a single row | 4,369 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| VendorID | int identity(1,1) | 10 | 4 | | no
| yes
| |
| no
| Primary key for Vendor records.
|
| AccountNumber | AccountNumber | 15 | 60 | | no
|
| |
| no
| Vendor account (identification) number.
|
| Name | Name | 50 | 200 | | no
|
| |
| no
| Company name.
|
| CreditRating | tinyint | 3 | 1 | | no
|
| |
| no
| 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average
|
| PreferredVendorStatus | Flag | 1 | 0 | ((1)) | no
|
| |
| no
| 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.
|
| ActiveFlag | Flag | 1 | 0 | ((1)) | no
|
| |
| no
| 0 = Vendor no longer used. 1 = Vendor is actively used.
|
| PurchasingWebServiceURL | nvarchar(1024) | 1024 | 4096 | | yes
|
| |
| no
| Vendor URL.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
| name | description | column | comment |
|---|
| AK_Vendor_AccountNumber | nonclustered, unique located on PRIMARY | AccountNumber | Unique nonclustered index.
|
| PK_Vendor_VendorID | clustered, unique, primary key located on PRIMARY | VendorID | Clustered index created by a primary key constraint.
|
Referenced by
Foreign key graph
Check constraints
| name | column | comment |
|---|
CK_Vendor_CreditRating([CreditRating]>=(1) AND [CreditRating]<=(5)) | CreditRating
| Check constraint [CreditRating] BETWEEN (1) AND (5)
|
Triggers
| name | comment |
|---|
| dVendor | INSTEAD OF DELETE trigger which keeps Vendors from being deleted.
|
Defaults
Dependency graph
Objects that [Purchasing].[Vendor] depends on
Objects that depend on [Purchasing].[Vendor]
Sample rows
| VendorID | AccountNumber | Name | CreditRating | PreferredVendorStatus | ActiveFlag | PurchasingWebServiceURL | ModifiedDate |
|---|
| 1
| INTERNAT0001
| International
| 1
| True
| True
| NULL
| 2/25/2002 12:00:00 AM
|
| 2
| ELECTRON0002
| Electronic Bike Repair & Supplies
| 1
| True
| True
| NULL
| 2/17/2002 12:00:00 AM
|
| 3
| PREMIER0001
| Premier Sport, Inc.
| 1
| True
| True
| NULL
| 3/5/2002 12:00:00 AM
|
| 4
| COMFORT0001
| Comfort Road Bicycles
| 1
| True
| True
| NULL
| 1/24/2002 12:00:00 AM
|
| 5
| METROSP0001
| Metro Sport Equipment
| 1
| True
| True
| NULL
| 3/1/2002 12:00:00 AM
|
| 6
| GREENLA0001
| Green Lake Bike Company
| 1
| True
| True
| NULL
| 3/1/2002 12:00:00 AM
|
| 7
| MOUNTAIN0001
| Mountain Works
| 1
| False
| True
| NULL
| 3/5/2002 12:00:00 AM
|
| 8
| CONTINEN0001
| Continental Pro Cycles
| 3
| True
| True
| NULL
| 1/24/2002 12:00:00 AM
|
| 9
| ADATUM0001
| A. Datum Corporation
| 1
| True
| True
| www.adatum.com/
| 1/24/2002 12:00:00 AM
|
| 10
| TREYRE0001
| Trey Research
| 3
| True
| True
| www.treyresearch.net/
| 2/25/2002 12:00:00 AM
|
Code
CREATE TABLE [Purchasing].[Vendor](
[VendorID] [int] IDENTITY(1,1) NOT NULL,
[AccountNumber] [dbo].[AccountNumber] NOT NULL,
[VendorID] [int] IDENTITY(1,1) 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,
CONSTRAINT [PK_Vendor_VendorID] PRIMARY KEY CLUSTERED
(
[VendorID] 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].[Vendor] WITH CHECK ADD CONSTRAINT [CK_Vendor_CreditRating] CHECK (([CreditRating]>=(1) AND [CreditRating]<=(5)))
ALTER TABLE [Purchasing].[Vendor] CHECK CONSTRAINT [CK_Vendor_CreditRating]
ALTER TABLE [Purchasing].[Vendor] ADD CONSTRAINT [DF_Vendor_PreferredVendorStatus] DEFAULT ((1)) FOR [PreferredVendorStatus]
ALTER TABLE [Purchasing].[Vendor] ADD CONSTRAINT [DF_Vendor_ActiveFlag] DEFAULT ((1)) FOR [ActiveFlag]
ALTER TABLE [Purchasing].[Vendor] ADD CONSTRAINT [DF_Vendor_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]