Description
Companies from whom Adventure Works Cycles purchases parts or other goods.
Table properties
| name | value |
|---|
| name | [Purchasing].[Vendor] |
| created | Mar 19 2009 9:09PM |
| modified | Mar 19 2009 9:10PM
|
| 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 |
|---|
| BusinessEntityID | int | 10 | 4 | | no
| yes
| BusinessEntity.BusinessEntityID
|
| no
| Primary key for Vendor records. Foreign key to BusinessEntity.BusinessEntityID
|
| 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_BusinessEntityID | clustered, unique, primary key located on PRIMARY | BusinessEntityID | Clustered index created by a primary key constraint.
|
References
Referenced by
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_Vendor_BusinessEntity_BusinessEntityID | BusinessEntityID | BusinessEntity.BusinessEntityID |
| Foreign key constraint referencing BusinessEntity.BusinessEntityID
|
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
| name | object type | database | server | level |
|---|
| AccountNumber | type | AdventureWorks2008 | SPRING\KATMAI | 1 |
| Flag | type | AdventureWorks2008 | SPRING\KATMAI | 1 |
| Name | type | AdventureWorks2008 | SPRING\KATMAI | 1 |
Objects that depend on [Purchasing].[Vendor]
Sample rows
| BusinessEntityID | AccountNumber | Name | CreditRating | PreferredVendorStatus | ActiveFlag | PurchasingWebServiceURL | ModifiedDate |
|---|
| 1492
| AUSTRALI0001
| Australia Bike Retailer
| 1
| True
| True
| NULL
| 1/23/2002 12:00:00 AM
|
| 1494
| ALLENSON0001
| Allenson Cycles
| 2
| True
| True
| NULL
| 5/26/2001 12:00:00 AM
|
| 1496
| ADVANCED0001
| Advanced Bicycles
| 1
| True
| True
| NULL
| 5/26/2001 12:00:00 AM
|
| 1498
| TRIKES0001
| Trikes, Inc.
| 2
| True
| True
| NULL
| 3/6/2002 12:00:00 AM
|
| 1500
| MORGANB0001
| Morgan Bike Accessories
| 1
| True
| True
| NULL
| 3/5/2002 12:00:00 AM
|
| 1502
| CYCLING0001
| Cycling Master
| 1
| True
| True
| NULL
| 1/24/2002 12:00:00 AM
|
| 1504
| CHICAGO0002
| Chicago Rent-All
| 2
| True
| True
| NULL
| 1/24/2002 12:00:00 AM
|
| 1506
| GREENWOO0001
| Greenwood Athletic Company
| 1
| True
| True
| NULL
| 2/25/2002 12:00:00 AM
|
| 1508
| COMPETE0001
| Compete Enterprises, Inc
| 1
| True
| True
| NULL
| 1/24/2002 12:00:00 AM
|
| 1510
| INTERNAT0001
| International
| 1
| True
| True
| NULL
| 2/25/2002 12:00:00 AM
|
Code
CREATE TABLE [Purchasing].[Vendor](
[BusinessEntityID] [int] NOT NULL,
[AccountNumber] [dbo].[AccountNumber] NOT NULL,
[BusinessEntityID] [int] 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_BusinessEntityID] PRIMARY KEY CLUSTERED
(
[BusinessEntityID] 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 [FK_Vendor_BusinessEntity_BusinessEntityID] FOREIGN KEY([BusinessEntityID])
REFERENCES [Person].[BusinessEntity] ([BusinessEntityID])
ALTER TABLE [Purchasing].[Vendor] CHECK CONSTRAINT [FK_Vendor_BusinessEntity_BusinessEntityID]
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]