Production.ProductInventory (table)

From dbscript Online Help
Jump to: navigation, search

wikibot[edit]

Table Production.ProductInventory
Description Product inventory information.

Columns[edit]

Column Data Type Nullable Default Description
ProductID int not null Product identification number. Foreign key to Product.ProductID.
LocationID smallint not null Inventory location identification number. Foreign key to Location.LocationID.
Shelf nvarchar(10) not null Storage compartment within an inventory location.
Bin tinyint not null Storage container on a shelf in an inventory location.
Quantity smallint not null ((0)) Quantity of products in the inventory location.
rowguid uniqueidentifier not null (newid()) ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDate datetime not null (getdate()) Date and time the record was last updated.

Primary Key[edit]

Primary Key Columns
PK_ProductInventory_ProductID_LocationID ProductID, LocationID

Check Constraints[edit]

Check Constraint Expression Description
CK_ProductInventory_Bin ([Bin]>=(0) AND [Bin]<=(100)) Check constraint [Bin] BETWEEN (0) AND (100)
CK_ProductInventory_Shelf ([Shelf] like '[A-Za-z]' OR [Shelf]='N/A') Check constraint [Shelf] like '[A-Za-z]' OR [Shelf]='N/A'

Foreign Keys[edit]

Relation Column Referenced Column
Production.Location LocationID LocationID
Production.Product ProductID ProductID

References[edit]

Dependency Type Object Type Referenced Object
Schema Schema Production

Dependencies[edit]

Reference Type Object Type Referencing Object
Select Function dbo.ufnGetStock


automatically generated[edit]

Table Production.ProductInventory
Description Product inventory information.


Column Data Type Nullable Default Description / PK / Index
ProductID int not null Product identification number. Foreign key to Product.ProductID.
PK_ProductInventory_ProductID_LocationID
LocationID smallint not null Inventory location identification number. Foreign key to Location.LocationID.
PK_ProductInventory_ProductID_LocationID
Shelf nvarchar(10) not null Storage compartment within an inventory location.
Bin tinyint not null Storage container on a shelf in an inventory location.
Quantity smallint not null (0) Quantity of products in the inventory location.
rowguid uniqueidentifier not null (NEWID()) ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
ModifiedDate datetime not null (GETDATE()) Date and time the record was last updated.


Relation Column Referenced Column
Production.Location LocationID LocationID
Production.Product ProductID ProductID


Dependency Type Object Type Referenced Object
Schema Schema Production


Reference Type Object Type Referencing Object
Select Function dbo.ufnGetStock