# Table: SpecialOffer

## Properties

Property | Value
--- | ---
Name | SpecialOffer
ID | 14623095
Owner | dbo
Schema | Sales
Filegroup | PRIMARY
Data Size (KB) | 8 KB
Index Size (KB) | 24 KB
Rows | 16
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 | Sale discounts lookup table.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | SpecialOfferID | int |  |  |
2 | Description | nvarchar(255) |  |  |
3 | DiscountPct | smallmoney |  |  |
4 | Type | nvarchar(50) |  |  |
5 | Category | nvarchar(50) |  |  |
6 | StartDate | datetime |  |  |
7 | EndDate | datetime |  |  |
8 | MinQty | int |  |  |
9 | MaxQty | int |  |  |
10 | rowguid | uniqueidentifier |  |  |
11 | ModifiedDate | datetime |  |  |

## Identity Columns

Column | Seed Value | Increment Value | Last Value | Is Not For Replication | Is Computed | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | --- | --- | ---
SpecialOfferID | 1 | 1 | 16 |  |  |  |

## Primary Key Constraints

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

## Primary Key Columns

Name
SpecialOfferID

## Foreign Keys

No foreign keys defined.

## 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_SpecialOffer_DiscountPct | 3 | DiscountPct | ([DiscountPct]>=(0.00)) |  |  |  |  |
CK_SpecialOffer_MinQty | 8 | MinQty | ([MinQty]>=(0)) |  |  |  |  |
CK_SpecialOffer_MaxQty | 9 | MaxQty | ([MaxQty]>=(0)) |  |  |  |  |

## Table Level Check Constraints

Name | Definition | Is Disabled | Is Not For Replication | Is Not Trusted | Uses Database Collation | Is System Named
--- | --- | --- | --- | --- | --- | ---
CK_SpecialOffer_EndDate | ([EndDate]>=[StartDate]) |  |  |  |  |

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_SpecialOffer_DiscountPct | DiscountPct | ((0.00)) |  | MS_Description | Default constraint value of 0.0
DF_SpecialOffer_MinQty | MinQty | ((0)) |  | MS_Description | Default constraint value of 0.0
DF_SpecialOffer_rowguid | rowguid | (newid()) |  | MS_Description | Default constraint value of NEWID()
DF_SpecialOffer_ModifiedDate | ModifiedDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_SpecialOffer_SpecialOfferID | CLUSTERED |  |  |  |  |
AK_SpecialOffer_rowguid | NONCLUSTERED |  |  |  |  |

## FullText Indexes

No fulltext indexes defined.

## Referencing Tables

Name | Key Index ID | Is Disabled | Is Not For Replication | Is Not Trusted | Delete Action | Update Action | Is System Named | Referencing Object
--- | --- | --- | --- | --- | --- | --- | --- | ---
FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID | 1 |  |  |  | No action | No action |  | Sales.SpecialOfferProduct

## 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_SpecialOffer_SpecialOfferID | Aug 8 2010 5:23PM | 16 | 16 | 9 | 1 | 4 |  |  | 16

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.0625 | 4 | SpecialOfferID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
1 | 0 | 1 | 0 | 1
3 | 1 | 1 | 1 | 1
5 | 1 | 1 | 1 | 1
7 | 1 | 1 | 1 | 1
9 | 1 | 1 | 1 | 1
11 | 1 | 1 | 1 | 1
13 | 1 | 1 | 1 | 1
15 | 1 | 1 | 1 | 1
16 | 0 | 1 | 0 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
AK_SpecialOffer_rowguid | Aug 8 2010 5:23PM | 16 | 16 | 13 | 1 | 20 |  |  | 16

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.0625 | 16 | rowguid
0.0625 | 20 | rowguid, SpecialOfferID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
0290c4f5-191f-4337-ab6b-0a2dde03cbf9 | 0 | 1 | 0 | 1
220444ad-2ef3-4e4c-87e9-3aa6ee39a877 | 1 | 1 | 1 | 1
c0af1c89-9722-4235-9248-3fba4d9e5841 | 0 | 1 | 0 | 1
4bdbcc01-8cf7-40a9-b643-40ec5b717491 | 0 | 1 | 0 | 1
677e1d9d-944f-4e81-90e8-47eb0a82d48c | 0 | 1 | 0 | 1
eb7cb484-bccf-4d2d-bf73-521b20014174 | 0 | 1 | 0 | 1
0cf8472b-f9e6-4945-9e09-549d7dde2198 | 0 | 1 | 0 | 1
d7542ee7-15db-4541-985c-5cc27aef26d6 | 0 | 1 | 0 | 1
8157f569-4e8d-46b6-9347-5d0f726a9439 | 0 | 1 | 0 | 1
504b5e85-8f3f-4ebc-9e1d-c1bc5dea9aa8 | 2 | 1 | 2 | 1
1af84a9e-a98c-4bd9-b48f-dc2b8b6b010b | 0 | 1 | 0 | 1
5061cce4-e021-45a8-9a75-dfb36cbbce85 | 0 | 1 | 0 | 1
e72dab1d-f44d-448b-9fe2-f259a2f0210d | 0 | 1 | 0 | 1

## Objects that depend on [SpecialOffer]

- Sales.SpecialOffer
  - Sales.SpecialOfferProduct
    - Sales.SalesOrderDetail
      - Sales.iduSalesOrderDetail
      - Sales.ufn_SalesByStore

## Objects on which [SpecialOffer] depends

- Sales.SpecialOffer

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [Sales].[SpecialOffer]( [SpecialOfferID] [int] IDENTITY(1,1) NOT NULL, [Description] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [DiscountPct] [smallmoney] NOT NULL, [Type] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Category] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [StartDate] [datetime] NOT NULL, [EndDate] [datetime] NOT NULL, [MinQty] [int] NOT NULL, [MaxQty] [int] NULL, [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL, [ModifiedDate] [datetime] NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for SpecialOffer records.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'SpecialOfferID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Discount description.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'Description' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Discount precentage.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'DiscountPct' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Discount type category.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'Type' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Group the discount applies to such as Reseller or Customer.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'Category' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Discount start date.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'StartDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Discount end date.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'EndDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Minimum discount percent allowed.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'MinQty' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Maximum discount percent allowed.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'MaxQty' 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'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @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'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer', @level2type=N'COLUMN',@level2name=N'ModifiedDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Sale discounts lookup table.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SpecialOffer'

#### See also

List of Tables