Table: [AdventureWorks2016CTP3].[Sales].[Store]

CollapseAll image

Collapse image Table properties


Name  Value 
 Schema  [Sales]
 Owner  [dbo]
 Table is replicated   
 Creation date  23.10.2015
 ID  846626059
 Located on  PRIMARY
 Data size KB  808 KB
 Index size KB  616 KB
 Rows  701
 ChangeTrackingEnabled   
 FileStreamFileGroup   
 FileStreamPartitionScheme   
 LockEscalation  TABLE
 TrackColumnsUpdatedEnabled   
 Table is filetable   
 Filetable directory   
 Filetable collate   
 Filetable primary key  [PK_Store_BusinessEntityID]
 Filetable streamid unique   
 Filetable fullpath unique   
 Filetable is enabled   
 Is memory optimized   
 Durability  SCHEMA_AND_DATA

Collapse image Creation options


Name  Value 
QUOTED_IDENTIFIER ON
ANSI_NULLS ON
ANSI_PADDING ON

Collapse image Columns


    Name  Description  Data type  Max length  Nullable  Default IsGUID  SPARSE Computed value
Primary key Foreign key BusinessEntityID     int 4        
    Name     [dbo].[Name] 50        
  Foreign key SalesPersonID     int 4      
    Demographics     xml([Sales].[StoreSurveySchemaCollection]) 2147483647      
    rowguid     uniqueidentifier 16   (newid())  
    ModifiedDate     datetime 8   (getdate())    
Total: 6 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[PK_Store_BusinessEntityID] BusinessEntityID   896 0
[AK_Store_rowguid] rowguid     40 0
[IX_Store_SalesPersonID] SalesPersonID       32 0
[PXML_Store_Demographics]         528 0
Total: 4 Index/indexes

Collapse image Columnstore indexes


No columnstore indexes exist

Collapse image Referencing tables


Table  Foreign key  Primary key or unique constraint 
[Sales].[Customer] FK_Customer_Store_StoreID PK_Store_BusinessEntityID
Total: 1 table(s)

Collapse image Referenced tables


Table  Primary key or unique constraint  Foreign key 
[Person].[BusinessEntity] PK_BusinessEntity_BusinessEntityID FK_Store_BusinessEntity_BusinessEntityID
[Sales].[SalesPerson] PK_SalesPerson_BusinessEntityID FK_Store_SalesPerson_SalesPersonID
Total: 2 table(s)

Collapse image Objects that depend on [Sales].[Store]


Object name Object type Dep level
[Sales].[Customer] Table 1
[dbo].[ufnGetContactInformation] Function 1
[Sales].[vStoreWithAddresses] View 1
[Sales].[vStoreWithContacts] View 1
[Sales].[vStoreWithDemographics] View 1
Total 5 object(s)

Collapse image Objects that [Sales].[Store] depends on


Object name Object type Dep level
[Sales] Schema 1
[Person].[BusinessEntity] Table 1
[Sales].[SalesPerson] Table 1
[dbo].[Name] Datatype 1
[Sales].[StoreSurveySchemaCollection] XML Schema Collection 1
Total 5 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Customers (resellers) of Adventure Works products.

Collapse image Table options


Name  Value 
Pintable OFF
Table lock on bulk load OFF
Insert row lock OFF
Text in row 0
Large value types out of row OFF

Collapse image SQL


SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
CREATE TABLE [Sales].[Store] (
        [BusinessEntityID]     [int] NOT NULL,
        [Name]                 [dbo].[Name] NOT NULL,
        [SalesPersonID]        [int] NULL,
        [Demographics]         [xml](CONTENT [Sales].[StoreSurveySchemaCollection]) NULL,
        [rowguid]              [uniqueidentifier] NOT NULL ROWGUIDCOL,
        [ModifiedDate]         [datetime] NOT NULL,
        CONSTRAINT [PK_Store_BusinessEntityID]
        PRIMARY KEY
        CLUSTERED
        ([BusinessEntityID])
    ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key (clustered) constraint', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'CONSTRAINT', N'PK_Store_BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Clustered index created by a primary key constraint.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'INDEX', N'PK_Store_BusinessEntityID'
GO
ALTER TABLE [Sales].[Store]
    ADD
    CONSTRAINT [DF_Store_ModifiedDate]
    DEFAULT (getdate()) FOR [ModifiedDate]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of GETDATE()', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'CONSTRAINT', N'DF_Store_ModifiedDate'
GO
ALTER TABLE [Sales].[Store]
    ADD
    CONSTRAINT [DF_Store_rowguid]
    DEFAULT (newid()) FOR [rowguid]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Default constraint value of NEWID()', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'CONSTRAINT', N'DF_Store_rowguid'
GO
ALTER TABLE [Sales].[Store]
    WITH CHECK
    ADD CONSTRAINT [FK_Store_BusinessEntity_BusinessEntityID]
    FOREIGN KEY ([BusinessEntityID]) REFERENCES [Person].[BusinessEntity] ([BusinessEntityID])
ALTER TABLE [Sales].[Store]
    CHECK CONSTRAINT [FK_Store_BusinessEntity_BusinessEntityID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing BusinessEntity.BusinessEntityID', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'CONSTRAINT', N'FK_Store_BusinessEntity_BusinessEntityID'
GO
ALTER TABLE [Sales].[Store]
    WITH CHECK
    ADD CONSTRAINT [FK_Store_SalesPerson_SalesPersonID]
    FOREIGN KEY ([SalesPersonID]) REFERENCES [Sales].[SalesPerson] ([BusinessEntityID])
ALTER TABLE [Sales].[Store]
    CHECK CONSTRAINT [FK_Store_SalesPerson_SalesPersonID]

GO
EXEC sp_addextendedproperty N'MS_Description', N'Foreign key constraint referencing SalesPerson.SalesPersonID', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'CONSTRAINT', N'FK_Store_SalesPerson_SalesPersonID'
GO
CREATE UNIQUE NONCLUSTERED INDEX [AK_Store_rowguid]
    ON [Sales].[Store] ([rowguid])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Unique nonclustered index. Used to support replication samples.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'INDEX', N'AK_Store_rowguid'
GO
CREATE NONCLUSTERED INDEX [IX_Store_SalesPersonID]
    ON [Sales].[Store] ([SalesPersonID])
    ON [PRIMARY]
GO
EXEC sp_addextendedproperty N'MS_Description', N'Nonclustered index.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'INDEX', N'IX_Store_SalesPersonID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary key. Foreign key to Customer.BusinessEntityID.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'COLUMN', N'BusinessEntityID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Demographic informationg about the store such as the number of employees, annual sales and store type.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'COLUMN', N'Demographics'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Date and time the record was last updated.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'COLUMN', N'ModifiedDate'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Name of the store.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'COLUMN', N'Name'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'COLUMN', N'rowguid'
GO
EXEC sp_addextendedproperty N'MS_Description', N'ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'COLUMN', N'SalesPersonID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'Customers (resellers) of Adventure Works products.', 'SCHEMA', N'Sales', 'TABLE', N'Store', NULL, NULL
GO
SET ANSI_PADDING ON
GO
CREATE PRIMARY XML INDEX [PXML_Store_Demographics]
    ON [Sales].[Store] ([Demographics])
GO
EXEC sp_addextendedproperty N'MS_Description', N'Primary XML index.', 'SCHEMA', N'Sales', 'TABLE', N'Store', 'INDEX', N'PXML_Store_Demographics'
GO

Collapse image See also


List of tables