Properties

Owner: Production 
Creation Date: 04/26/2006 
Located On: PRIMARY 
Data Size KB: 56 
Index Size KB: 16 
Rows: 1069 
Description: Product inventory information. 

Columns

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

Indexes

Index Primary Unique Description
  PK_ProductInventory_ProductID_LocationID      Primary key (clustered) constraint 
Total: 1 index(es)

Check Constraints

Name Expression
  CK_ProductInventory_Bin  ([Bin]>=(0) AND [Bin]<=(100)) 
  CK_ProductInventory_Shelf  ([Shelf] like '[A-Za-z]' OR [Shelf]='N/A') 
Total: 2 constraint(s)

Referenced Tables

Table Foreign Key Primary Key or Unique Constraint
  Production.Location  FK_ProductInventory_Location_LocationID  PK_Location_LocationID 
  Production.Product  FK_ProductInventory_Product_ProductID  PK_Product_ProductID 
Total: 2 table(s)

Objects that [Production].[ProductInventory] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  Location  Production  Table 
  ProductCategory  Production  Table 
  ProductModel  Production  Table 
  UnitMeasure  Production  Table 
  ProductSubcategory  Production  Table 
  Product  Production  Table 
Total: 8 object(s)

Objects that depend on [Production].[ProductInventory]

Object Name Owner Object Type Dep Level
  ufnGetStock  dbo  Function 
Total: 1 object(s)

SQL

CREATE TABLE [ProductInventory] (
    [ProductID] [int] NOT NULL ,
    [LocationID] [smallint] NOT NULL ,
    [Shelf] [nvarchar] (10) COLLATE Latin1_General_CS_AS NOT NULL ,
    [Bin] [tinyint] NOT NULL ,
    [Quantity] [smallint] NOT NULL CONSTRAINT [DF_ProductInventory_Quantity] DEFAULT ((0)),
    [rowguid]  uniqueidentifier ROWGUIDCOL  NOT NULL CONSTRAINT [DF_ProductInventory_rowguid] DEFAULT (newid()),
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductInventory_ModifiedDate] DEFAULT (getdate()),
    CONSTRAINT [PK_ProductInventory_ProductID_LocationID] PRIMARY KEY  CLUSTERED
    (
        [ProductID],
        [LocationID]
    )  ON [PRIMARY] ,
    CONSTRAINT [FK_ProductInventory_Location_LocationID] FOREIGN KEY
    (
        [LocationID]
    ) REFERENCES [Location] (
        [LocationID]
    ),
    CONSTRAINT [FK_ProductInventory_Product_ProductID] FOREIGN KEY
    (
        [ProductID]
    ) REFERENCES [Product] (
        [ProductID]
    ),
    CONSTRAINT [CK_ProductInventory_Bin] CHECK ([Bin]>=(0) AND [Bin]<=(100)),
    CONSTRAINT [CK_ProductInventory_Shelf] CHECK ([Shelf] like '[A-Za-z]' OR [Shelf]='N/A')
) ON [PRIMARY]
GO


See Also

List of tables