Description
Product inventory information.
Table properties
| name | value |
|---|
| name | [Production].[ProductInventory] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 1,069 |
| Size of data | 56 kb |
| Size of indexes | 16 kb |
| Maximum size of a single row | 73 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| ProductID | int | 10 | 4 | | no
| composite PK
| Product.ProductID
|
| no
| Product identification number. Foreign key to Product.ProductID.
|
| LocationID | smallint | 5 | 2 | | no
| composite PK
| Location.LocationID
|
| no
| Inventory location identification number. Foreign key to Location.LocationID.
|
| Shelf | nvarchar(10) | 10 | 40 | | no
|
| |
| no
| Storage compartment within an inventory location.
|
| Bin | tinyint | 3 | 1 | | no
|
| |
| no
| Storage container on a shelf in an inventory location.
|
| Quantity | smallint | 5 | 2 | ((0)) | no
|
| |
| no
| Quantity of products in the inventory location.
|
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no
|
| |
| no
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_ProductInventory_Location_LocationID | LocationID | Location.LocationID |
| Foreign key constraint referencing Location.LocationID.
|
| FK_ProductInventory_Product_ProductID | ProductID | Product.ProductID |
| Foreign key constraint referencing Product.ProductID.
|
Check constraints
| name | column | comment |
|---|
CK_ProductInventory_Shelf([Shelf] like '[A-Za-z]' OR [Shelf]='N/A') | Shelf
| Check constraint [Shelf] like '[A-Za-z]' OR [Shelf]='N/A'
|
CK_ProductInventory_Bin([Bin]>=(0) AND [Bin]<=(100)) | Bin
| Check constraint [Bin] BETWEEN (0) AND (100)
|
Defaults
Dependency graph
Objects that depend on [Production].[ProductInventory]
Sample rows
| ProductID | LocationID | Shelf | Bin | Quantity | rowguid | ModifiedDate |
|---|
| 1
| 1
| A
| 1
| 408
| 47a24246-6c43-48eb-968f-025738a8a410
| 9/8/2004 12:00:00 AM
|
| 1
| 6
| B
| 5
| 324
| d4544d7d-caf5-46b3-ab22-5718dcc26b5e
| 9/8/2004 12:00:00 AM
|
| 1
| 50
| A
| 5
| 353
| bff7dc60-96a8-43ca-81a7-d6d2ed3000a8
| 9/8/2004 12:00:00 AM
|
| 2
| 1
| A
| 2
| 427
| f407c07a-ca14-4684-a02c-608bd00c2233
| 9/8/2004 12:00:00 AM
|
| 2
| 6
| B
| 1
| 318
| ca1ff2f4-48fb-4960-8d92-3940b633e4c1
| 9/8/2004 12:00:00 AM
|
| 2
| 50
| A
| 6
| 364
| d38cfbee-6347-47b1-b033-0e278cca03e2
| 9/8/2004 12:00:00 AM
|
| 3
| 1
| A
| 7
| 585
| e18a519b-fb5e-4051-874c-58cd58436c95
| 5/2/1998 12:00:00 AM
|
| 3
| 6
| B
| 9
| 443
| 3c860c96-15ff-4df4-91d7-b237ff64480f
| 5/2/1998 12:00:00 AM
|
| 3
| 50
| A
| 10
| 324
| 1339e5e3-1f8e-4b82-a447-a8666a264f0c
| 5/2/1998 12:00:00 AM
|
| 4
| 1
| A
| 6
| 512
| 6beaf0a0-971a-4ce1-96fe-692807d5dc00
| 9/8/2004 12:00:00 AM
|
Code
CREATE TABLE [Production].[ProductInventory](
[ProductID] [int] NOT NULL,
[LocationID] [smallint] NOT NULL,
[Shelf] [nvarchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Bin] [tinyint] NOT NULL,
[Quantity] [smallint] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ProductInventory_ProductID_LocationID] PRIMARY KEY CLUSTERED
(
[ProductID] ASC,
[LocationID] 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 [Production].[ProductInventory] WITH CHECK ADD CONSTRAINT [FK_ProductInventory_Location_LocationID] FOREIGN KEY([LocationID])
REFERENCES [Production].[Location] ([LocationID])
ALTER TABLE [Production].[ProductInventory] CHECK CONSTRAINT [FK_ProductInventory_Location_LocationID]
ALTER TABLE [Production].[ProductInventory] WITH CHECK ADD CONSTRAINT [FK_ProductInventory_Product_ProductID] FOREIGN KEY([ProductID])
REFERENCES [Production].[Product] ([ProductID])
ALTER TABLE [Production].[ProductInventory] CHECK CONSTRAINT [FK_ProductInventory_Product_ProductID]
ALTER TABLE [Production].[ProductInventory] WITH CHECK ADD CONSTRAINT [CK_ProductInventory_Bin] CHECK (([Bin]>=(0) AND [Bin]<=(100)))
ALTER TABLE [Production].[ProductInventory] CHECK CONSTRAINT [CK_ProductInventory_Bin]
ALTER TABLE [Production].[ProductInventory] WITH CHECK ADD CONSTRAINT [CK_ProductInventory_Shelf] CHECK (([Shelf] like '[A-Za-z]' OR [Shelf]='N/A'))
ALTER TABLE [Production].[ProductInventory] CHECK CONSTRAINT [CK_ProductInventory_Shelf]
ALTER TABLE [Production].[ProductInventory] ADD CONSTRAINT [DF_ProductInventory_Quantity] DEFAULT ((0)) FOR [Quantity]
ALTER TABLE [Production].[ProductInventory] ADD CONSTRAINT [DF_ProductInventory_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Production].[ProductInventory] ADD CONSTRAINT [DF_ProductInventory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]