| Field Name | Data Type | Size | Original Type | Default | Nullable | Description | Check |
|---|---|---|---|---|---|---|---|
| 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. | ([Shelf] like '[A-Za-z]' OR [Shelf]='N/A') | ||
| Bin | tinyint | Not null | Storage container on a shelf in an inventory location. | ([Bin]>=(0) AND [Bin]<=(100)) | |||
| Quantity | smallint | (0) | Not null | Quantity of products in the inventory location. | |||
| rowguid | uniqueidentifier | newid() | Not null | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | |||
| ModifiedDate | datetime | getdate() | Not null | Date and time the record was last updated. |
The object has no extended properties.
| Primary Key Name | Field Names |
|---|---|
| PK_ProductInventory_ProductID_LocationID | ProductID, LocationID |
| Foreign | Primary | Key Name |
|---|---|---|
| ProductInventory.LocationID | Location.LocationID | FK_ProductInventory_Location_LocationID |
| ProductInventory.ProductID | Product.ProductID | FK_ProductInventory_Product_ProductID |
| Index Name | Description | Clustered | Unique | Fields |
|---|---|---|---|---|
| PK_ProductInventory_ProductID_LocationID | Clustered index created by a primary key constraint. | Yes | Yes | ProductID, LocationID |
| Name | Description | Type | Enabled |
|---|---|---|---|
| uProductInventory | AFTER UPDATE trigger setting the ModifiedDate column in the ProductInventory table to the current date. | after Update | Yes |
| Object Name | Type | Field Name |
|---|---|---|
| dbo.ufnGetStock | scalar function | N/A |
| Production.CK_ProductInventory_Bin | check cns | N/A |
| Production.CK_ProductInventory_Shelf | check cns | N/A |
| Production.uProductInventory | trigger | N/A |