# Table: ShoppingCartItem

## Properties

Property | Value
--- | ---
Name | ShoppingCartItem
ID | 2082106458
Owner | dbo
Schema | Sales
Filegroup | PRIMARY
Data Size (KB) | 8 KB
Index Size (KB) | 24 KB
Rows | 3
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:43 PM
Create Date | 8/8/2010 5:21:53 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Contains online customer orders until the order is submitted or cancelled.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | ShoppingCartItemID | int |  |  |
2 | ShoppingCartID | nvarchar(50) |  |  |
3 | Quantity | int |  |  |
4 | ProductID | int |  |  |
5 | DateCreated | datetime |  |  |
6 | ModifiedDate | datetime |  |  |

## Identity Columns

Column | Seed Value | Increment Value | Last Value | Is Not For Replication | Is Computed | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | --- | --- | ---
ShoppingCartItemID | 1 | 1 | 5 |  |  |  |

## Primary Key Constraints

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

## Primary Key Columns

Name
ShoppingCartItemID

## Foreign Keys

Name | Referenced Object | Update Action | Delete Action
--- | --- | --- | ---
FK_ShoppingCartItem_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_ShoppingCartItem_Quantity | 3 | Quantity | ([Quantity]>=(1)) |  |  |  |  |

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_ShoppingCartItem_Quantity | Quantity | ((1)) |  | MS_Description | Default constraint value of 1
DF_ShoppingCartItem_DateCreated | DateCreated | (getdate()) |  | MS_Description | Default constraint value of GETDATE()
DF_ShoppingCartItem_ModifiedDate | ModifiedDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_ShoppingCartItem_ShoppingCartItemID | CLUSTERED |  |  |  |  |
IX_ShoppingCartItem_ShoppingCartID_ProductID | NONCLUSTERED |  |  |  |  |

## FullText Indexes

No fulltext indexes defined.

## Referencing Tables

No referencing tables defined.

## Object Level Permissions

No object level permissions defined.

## 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_ShoppingCartItem_ShoppingCartItemID | Aug 8 2010 5:23PM | 3 | 3 | 3 | 0 | 4 |  |  | 3

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.3333333 | 4 | ShoppingCartItemID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
2 | 0 | 1 | 0 | 1
4 | 0 | 1 | 0 | 1
5 | 0 | 1 | 0 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
IX_ShoppingCartItem_ShoppingCartID_ProductID | Aug 8 2010 5:23PM | 3 | 3 | 2 | 0 | 18 |  |  | 3

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.5 | 10 | ShoppingCartID
0.3333333 | 14 | ShoppingCartID, ProductID
0.3333333 | 18 | ShoppingCartID, ProductID, ShoppingCartItemID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
14951 | 0 | 1 | 0 | 1
20621 | 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_00000004_7C1A6C5A | Aug 8 2010 5:23PM | 3 | 3 | 3 | 0 | 4 |  |  | 3

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.3333333 | 4 | ProductID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
862 | 0 | 1 | 0 | 1
874 | 0 | 1 | 0 | 1
881 | 0 | 1 | 0 | 1

## Objects that depend on [ShoppingCartItem]

- Sales.ShoppingCartItem

## Objects on which [ShoppingCartItem] depends

- Sales.ShoppingCartItem
  - Production.Product
    - Production.ProductSubcategory
      - Production.ProductCategory
        - dbo.Name
    - Production.ProductModel
      - Production.ProductDescriptionSchemaCollection
      - Production.ManuInstructionsSchemaCollection
    - Production.UnitMeasure
    - dbo.Flag

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [Sales].[ShoppingCartItem]( [ShoppingCartItemID] [int] IDENTITY(1,1) NOT NULL, [ShoppingCartID] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Quantity] [int] NOT NULL, [ProductID] [int] NOT NULL, [DateCreated] [datetime] NOT NULL, [ModifiedDate] [datetime] NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for ShoppingCartItem records.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem', @level2type=N'COLUMN',@level2name=N'ShoppingCartItemID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Shopping cart identification number.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem', @level2type=N'COLUMN',@level2name=N'ShoppingCartID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Product quantity ordered.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem', @level2type=N'COLUMN',@level2name=N'Quantity' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Product ordered. Foreign key to Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem', @level2type=N'COLUMN',@level2name=N'ProductID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date the time the record was created.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem', @level2type=N'COLUMN',@level2name=N'DateCreated' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time the record was last updated.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem', @level2type=N'COLUMN',@level2name=N'ModifiedDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Contains online customer orders until the order is submitted or cancelled.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'ShoppingCartItem'

#### See also

List of Tables