PRODUCTVENDOR

Defines an association between a product and a vendor.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.

Foreign Keys

Foreign Key Field Type Null Notes Description
VENDORID uniqueidentifier VENDOR.ID The vendor record.
PRODUCTID uniqueidentifier PRODUCT.ID The product record.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_PRODUCTVENDOR_DATEADDED DATEADDED yes
IX_PRODUCTVENDOR_DATECHANGED DATECHANGED
IX_PRODUCTVENDOR_PRODUCTID PRODUCTID
PK_PRODUCTVENDOR ID yes yes
UIX_PRODUCTVENDOR_VENDORID_PRODUCTID VENDORID, PRODUCTID yes

Triggers

Trigger Name Description
TR_PRODUCTVENDOR_AUDIT_UPDATE
TR_PRODUCTVENDOR_AUDIT_DELETE