# Table: ProductInventory

## Properties

Property | Value
--- | ---
Name | ProductInventory
ID | 2099048
Owner | dbo
Schema | Production
Filegroup | PRIMARY
Data Size (KB) | 56 KB
Index Size (KB) | 16 KB
Rows | 1069
Unused (KB) | 0 KB
ANSI Null On |
Quoted Identifier |
Lock Escalation | TABLE
Lock On Bulk Load |
Lob Data Space |
Filestream Data Space ID |
Has Unchecked Assembly Data |
Text In Row Limit (bytes) | Option not set
Large Value Types Out Of Row |
FullText Change Tracking On |
Tracked By Cdc |
Published |
Schema Published |
Replicated |
Replication Filter |
Merge Published |
Sync Tran Subscribed |
MS Shipped |
Modify Date | 8/8/2010 5:23:39 PM
Create Date | 8/8/2010 5:21:51 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Product inventory information.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | ProductID | int |  |  |
2 | LocationID | smallint |  |  |
3 | Shelf | nvarchar(10) |  |  |
4 | Bin | tinyint |  |  |
5 | Quantity | smallint |  |  |
6 | rowguid | uniqueidentifier |  |  |
7 | ModifiedDate | datetime |  |  |

## Identity Columns

No identity columns defined.

## Primary Key Constraints

Name | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | ---
PK_ProductInventory_ProductID_LocationID |  | MS_Description | Primary key (clustered) constraint

## Primary Key Columns

Name
ProductID
LocationID

## Foreign Keys

Name | Referenced Object | Update Action | Delete Action
--- | --- | --- | ---
FK_ProductInventory_Location_LocationID | Production.Location | No action | No action
FK_ProductInventory_Product_ProductID | Production.Product | No action | No action

## Column Level Check Constraints

Name | Column ID | Column | Definition | Is Disabled | Is Not For Replication | Is Not Trusted | Uses Database Collation | Is System Named
--- | --- | --- | --- | --- | --- | --- | --- | ---
CK_ProductInventory_Shelf | 3 | Shelf | ([Shelf] like '[A-Za-z]' OR [Shelf]='N/A') |  |  |  |  |
CK_ProductInventory_Bin | 4 | Bin | ([Bin]>=(0) AND [Bin]<=(100)) |  |  |  |  |

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_ProductInventory_Quantity | Quantity | ((0)) |  | MS_Description | Default constraint value of 0
DF_ProductInventory_rowguid | rowguid | (newid()) |  | MS_Description | Default constraint value of NEWID()
DF_ProductInventory_ModifiedDate | ModifiedDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_ProductInventory_ProductID_LocationID | CLUSTERED |  |  |  |  |

## FullText Indexes

No fulltext indexes defined.

## Referencing Tables

No referencing tables defined.

## Object Level Permissions

#### Permissions for: JohnBlack

Permission | Grantor | Grant | With Grant Option | Deny
--- | --- | --- | --- | ---
Alter |  |  |  |
Control |  |  |  |
Delete |  |  |  |
Insert |  |  |  |
References |  |  |  |
Select | dbo |  |  |
Take Ownership |  |  |  |
Update |  |  |  |
View Change Tracking |  |  |  |
View Definition |  |  |  |

## Column Level Permissions

No explicit column permissions granted to this object

## Statistics

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
PK_ProductInventory_ProductID_LocationID | Aug 8 2010 5:22PM | 1069 | 1069 | 198 | 0.4262295 | 6 |  |  | 1069

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.002314815 | 4 | ProductID
0.0009354537 | 6 | ProductID, LocationID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
1 | 0 | 3 | 0 | 1
4 | 6 | 3 | 2 | 3
317 | 3 | 3 | 1 | 3
319 | 3 | 3 | 1 | 3
321 | 3 | 3 | 1 | 3
323 | 3 | 3 | 1 | 3
325 | 3 | 3 | 1 | 3
327 | 3 | 3 | 1 | 3
329 | 3 | 3 | 1 | 3
331 | 3 | 3 | 1 | 3
341 | 3 | 3 | 1 | 3
343 | 3 | 3 | 1 | 3
345 | 3 | 3 | 1 | 3
347 | 3 | 3 | 1 | 3
349 | 3 | 3 | 1 | 3
351 | 3 | 3 | 1 | 3
357 | 9 | 3 | 3 | 3
359 | 3 | 3 | 1 | 3
361 | 3 | 3 | 1 | 3
363 | 3 | 3 | 1 | 3
365 | 3 | 3 | 1 | 3
367 | 3 | 3 | 1 | 3
369 | 3 | 3 | 1 | 3
371 | 3 | 3 | 1 | 3
373 | 3 | 3 | 1 | 3
375 | 3 | 3 | 1 | 3
377 | 3 | 3 | 1 | 3
379 | 3 | 3 | 1 | 3
381 | 3 | 3 | 1 | 3
383 | 3 | 3 | 1 | 3
385 | 3 | 3 | 1 | 3
387 | 3 | 3 | 1 | 3
389 | 3 | 3 | 1 | 3
391 | 3 | 3 | 1 | 3
393 | 3 | 3 | 1 | 3
395 | 3 | 3 | 1 | 3
397 | 3 | 3 | 1 | 3
399 | 3 | 3 | 1 | 3
401 | 3 | 3 | 1 | 3
403 | 3 | 3 | 1 | 3
405 | 3 | 3 | 1 | 3
407 | 3 | 3 | 1 | 3
409 | 3 | 3 | 1 | 3
411 | 3 | 3 | 1 | 3
413 | 3 | 3 | 1 | 3
415 | 3 | 3 | 1 | 3
417 | 3 | 3 | 1 | 3
419 | 3 | 3 | 1 | 3
421 | 3 | 3 | 1 | 3
423 | 3 | 3 | 1 | 3
425 | 3 | 3 | 1 | 3
427 | 3 | 3 | 1 | 3
429 | 3 | 3 | 1 | 3
431 | 3 | 3 | 1 | 3
433 | 3 | 3 | 1 | 3
435 | 3 | 3 | 1 | 3
437 | 3 | 3 | 1 | 3
439 | 3 | 3 | 1 | 3
441 | 3 | 3 | 1 | 3
443 | 3 | 3 | 1 | 3
445 | 3 | 3 | 1 | 3
447 | 3 | 3 | 1 | 3
449 | 3 | 3 | 1 | 3
451 | 3 | 3 | 1 | 3
453 | 3 | 3 | 1 | 3
455 | 3 | 3 | 1 | 3
457 | 3 | 3 | 1 | 3
459 | 3 | 3 | 1 | 3
461 | 3 | 3 | 1 | 3
463 | 3 | 3 | 1 | 3
465 | 3 | 3 | 1 | 3
467 | 3 | 3 | 1 | 3
469 | 3 | 3 | 1 | 3
471 | 3 | 3 | 1 | 3
473 | 3 | 3 | 1 | 3
475 | 3 | 3 | 1 | 3
477 | 3 | 3 | 1 | 3
479 | 3 | 3 | 1 | 3
481 | 3 | 3 | 1 | 3
483 | 3 | 3 | 1 | 3
485 | 3 | 3 | 1 | 3
487 | 3 | 3 | 1 | 3
489 | 3 | 3 | 1 | 3
491 | 3 | 3 | 1 | 3
493 | 3 | 3 | 1 | 3
495 | 3 | 3 | 1 | 3
497 | 3 | 3 | 1 | 3
505 | 3 | 3 | 1 | 3
508 | 5 | 2 | 2 | 2.5
510 | 2 | 2 | 1 | 2
513 | 4 | 2 | 2 | 2
515 | 3 | 3 | 1 | 3
517 | 3 | 3 | 1 | 3
519 | 3 | 3 | 1 | 3
521 | 3 | 3 | 1 | 3
523 | 3 | 3 | 1 | 3
525 | 3 | 2 | 1 | 3
527 | 2 | 2 | 1 | 2
529 | 2 | 2 | 1 | 2
531 | 2 | 2 | 1 | 2
533 | 2 | 2 | 1 | 2
679 | 4 | 3 | 2 | 2
710 | 3 | 1 | 3 | 1
714 | 3 | 1 | 3 | 1
747 | 2 | 6 | 2 | 1
748 | 0 | 6 | 0 | 1
750 | 2 | 2 | 1 | 2
752 | 2 | 2 | 1 | 2
754 | 2 | 2 | 1 | 2
756 | 2 | 2 | 1 | 2
758 | 2 | 2 | 1 | 2
760 | 2 | 2 | 1 | 2
762 | 2 | 2 | 1 | 2
764 | 2 | 2 | 1 | 2
766 | 2 | 2 | 1 | 2
768 | 2 | 2 | 1 | 2
770 | 2 | 2 | 1 | 2
772 | 2 | 2 | 1 | 2
774 | 2 | 2 | 1 | 2
776 | 2 | 2 | 1 | 2
778 | 2 | 2 | 1 | 2
780 | 2 | 2 | 1 | 2
782 | 2 | 2 | 1 | 2
784 | 2 | 2 | 1 | 2
786 | 2 | 2 | 1 | 2
788 | 2 | 2 | 1 | 2
790 | 2 | 2 | 1 | 2
792 | 2 | 2 | 1 | 2
794 | 2 | 2 | 1 | 2
796 | 2 | 2 | 1 | 2
798 | 2 | 2 | 1 | 2
801 | 4 | 2 | 2 | 2
803 | 3 | 3 | 1 | 3
805 | 3 | 3 | 1 | 3
807 | 3 | 3 | 1 | 3
809 | 3 | 3 | 1 | 3
811 | 3 | 3 | 1 | 3
813 | 3 | 3 | 1 | 3
814 | 0 | 6 | 0 | 1
816 | 2 | 2 | 1 | 2
818 | 2 | 2 | 1 | 2
820 | 2 | 2 | 1 | 2
822 | 2 | 6 | 1 | 2
824 | 2 | 2 | 1 | 2
826 | 2 | 2 | 1 | 2
829 | 4 | 2 | 2 | 2
844 | 3 | 1 | 3 | 1
848 | 3 | 1 | 3 | 1
852 | 3 | 1 | 3 | 1
856 | 3 | 1 | 3 | 1
860 | 3 | 1 | 3 | 1
864 | 3 | 1 | 3 | 1
868 | 3 | 1 | 3 | 1
872 | 3 | 1 | 3 | 1
876 | 3 | 1 | 3 | 1
880 | 3 | 1 | 3 | 1
884 | 3 | 1 | 3 | 1
907 | 3 | 3 | 1 | 3
909 | 3 | 3 | 1 | 3
911 | 3 | 3 | 1 | 3
913 | 3 | 3 | 1 | 3
915 | 3 | 3 | 1 | 3
922 | 5 | 2 | 2 | 2.5
928 | 2 | 2 | 1 | 2
930 | 2 | 2 | 1 | 2
932 | 2 | 2 | 1 | 2
934 | 2 | 2 | 1 | 2
936 | 3 | 3 | 1 | 3
938 | 3 | 3 | 1 | 3
940 | 3 | 3 | 1 | 3
942 | 3 | 6 | 1 | 3
944 | 6 | 6 | 1 | 6
946 | 3 | 3 | 1 | 3
948 | 3 | 2 | 1 | 3
950 | 3 | 3 | 1 | 3
952 | 3 | 3 | 1 | 3
954 | 2 | 2 | 1 | 2
956 | 2 | 2 | 1 | 2
958 | 2 | 2 | 1 | 2
960 | 2 | 2 | 1 | 2
962 | 2 | 2 | 1 | 2
964 | 2 | 2 | 1 | 2
966 | 2 | 2 | 1 | 2
968 | 2 | 2 | 1 | 2
970 | 2 | 2 | 1 | 2
972 | 2 | 2 | 1 | 2
974 | 2 | 2 | 1 | 2
976 | 2 | 2 | 1 | 2
978 | 2 | 2 | 1 | 2
980 | 2 | 2 | 1 | 2
982 | 2 | 2 | 1 | 2
985 | 4 | 2 | 2 | 2
988 | 4 | 2 | 2 | 2
991 | 4 | 2 | 2 | 2
994 | 4 | 3 | 2 | 2
996 | 3 | 3 | 1 | 3
998 | 2 | 2 | 1 | 2
999 | 0 | 2 | 0 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
_WA_Sys_00000002_00200768 | Aug 8 2010 5:23PM | 1069 | 1069 | 13 | 0.2 | 2 |  |  | 1069

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.07142857 | 2 | LocationID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
1 | 0 | 167 | 0 | 1
2 | 0 | 12 | 0 | 1
4 | 5 | 5 | 1 | 5
5 | 0 | 51 | 0 | 1
6 | 0 | 201 | 0 | 1
7 | 0 | 151 | 0 | 1
10 | 0 | 46 | 0 | 1
20 | 0 | 20 | 0 | 1
30 | 0 | 7 | 0 | 1
40 | 0 | 9 | 0 | 1
45 | 0 | 3 | 0 | 1
50 | 0 | 251 | 0 | 1
60 | 0 | 141 | 0 | 1

## Objects that depend on [ProductInventory]

- Production.ProductInventory
  - dbo.ufnGetStock

## Objects on which [ProductInventory] depends

- Production.ProductInventory
  - Production.Product
    - Production.ProductSubcategory
      - Production.ProductCategory
        - dbo.Name
    - Production.UnitMeasure
    - Production.ProductModel
      - Production.ManuInstructionsSchemaCollection
      - Production.ProductDescriptionSchemaCollection
    - dbo.Flag
  - Production.Location

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON 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 ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Product identification number. Foreign key to Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'ProductID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Inventory location identification number. Foreign key to Location.LocationID. ' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'LocationID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Storage compartment within an inventory location.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'Shelf' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Storage container on a shelf in an inventory location.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'Bin' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Quantity of products in the inventory location.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'Quantity' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'rowguid' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time the record was last updated.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory', @level2type=N'COLUMN',@level2name=N'ModifiedDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Product inventory information.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductInventory'

#### See also

List of Tables