Description
Customers (resellers) of Adventure Works products.
Table properties
| name | value |
|---|
| name | [Sales].[Store] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 701 |
| Size of data | 808 kb |
| Size of indexes | 80 kb |
| Maximum size of a single row | 2,147,483,878 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| CustomerID | int | 10 | 4 | | no
| yes
| Customer.CustomerID
|
| no
| Primary key. Foreign key to Customer.CustomerID.
|
| Name | Name | 50 | 200 | | no
|
| |
| no
| Name of the store.
|
| SalesPersonID | int | 10 | 4 | | yes
|
| SalesPerson.SalesPersonID
|
| no
| ID of the sales person assigned to the customer. Foreign key to SalesPerson.SalesPersonID.
|
| Demographics | xml | max | 2147483646 | | yes
|
| |
| no
| Demographic informationg about the store such as the number of employees, annual sales and store type.
|
| 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
| name | description | column | comment |
|---|
| AK_Store_rowguid | nonclustered, unique located on PRIMARY | rowguid | Unique nonclustered index. Used to support replication samples.
|
| IX_Store_SalesPersonID | nonclustered located on PRIMARY | SalesPersonID | Nonclustered index.
|
| PK_Store_CustomerID | clustered, unique, primary key located on PRIMARY | CustomerID | Clustered index created by a primary key constraint.
|
| PXML_Store_Demographics | | Demographics |
|
References
Referenced by
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_Store_Customer_CustomerID | CustomerID | Customer.CustomerID |
| Foreign key constraint referencing Customer.CustomerID.
|
| FK_Store_SalesPerson_SalesPersonID | SalesPersonID | SalesPerson.SalesPersonID |
| Foreign key constraint referencing SalesPerson.SalesPersonID
|
Triggers
| name | comment |
|---|
| iStore | AFTER INSERT trigger inserting Store only if the Customer does not exist in the Individual table.
|
Defaults
Dependency graph
Objects that [Sales].[Store] depends on
| name | object type | level |
|---|
| Name | type | 1 |
Objects that depend on [Sales].[Store]
Sample rows
| CustomerID | Name | SalesPersonID | Demographics | rowguid | ModifiedDate |
|---|
| 1
| A Bike Store
| 280
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| 80b15702-df20-4df9-876c-2cf1c3978d39
| 10/13/2004 11:15:07 AM
|
| 2
| Progressive Sports
| 283
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| e88b2a4c-72d3-4818-9f94-c59633d66ce8
| 10/13/2004 11:15:07 AM
|
| 3
| Advanced Bike Components
| 277
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| 42bdf4b8-bff2-4a04-b0d3-ebb5896025ce
| 10/13/2004 11:15:07 AM
|
| 4
| Modular Cycle Systems
| 277
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| a232dae8-2411-4fdc-bbb2-6eb5f547986b
| 10/13/2004 11:15:07 AM
|
| 5
| Metropolitan Sports Supply
| 281
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| 058dea7c-58fd-42e5-a199-b19c669e985c
| 10/13/2004 11:15:07 AM
|
| 6
| Aerobic Exercise Company
| 276
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| 690b6d1f-f71e-4bb8-b87d-baeb505135ef
| 10/13/2004 11:15:07 AM
|
| 7
| Associated Bikes
| 281
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| 22e7c8dd-5feb-4b87-abf2-d87bc0aa4695
| 10/13/2004 11:15:07 AM
|
| 8
| Exemplary Cycles
| 279
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| ab2ab66c-9002-4a91-96c9-2e9cb0881e96
| 10/13/2004 11:15:07 AM
|
| 9
| Tandem Bicycle Store
| 279
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| b6437d59-886a-4aa2-8463-62bbfb9e0c65
| 10/13/2004 11:15:07 AM
|
| 10
| Rural Cycle Emporium
| 282
| <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...
| 59deae0a-7b98-4b25-9431-1be36365167f
| 10/13/2004 11:15:07 AM
|
Code
CREATE TABLE [Sales].[Store](
[CustomerID] [int] NOT NULL,
[Name] [dbo].[Name] NOT NULL,
[SalesPersonID] [int] NULL,
[Demographics] [xml](CONTENT [Sales].[StoreSurveySchemaCollection]) NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[CustomerID] [int] NOT NULL,
[Name] [dbo].[Name] NOT NULL,
[SalesPersonID] [int] NULL,
[Demographics] [xml](CONTENT [Sales].[StoreSurveySchemaCollection]) NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Store_CustomerID] PRIMARY KEY CLUSTERED
(
[CustomerID] 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 [Sales].[Store] WITH CHECK ADD CONSTRAINT [FK_Store_Customer_CustomerID] FOREIGN KEY([CustomerID])
REFERENCES [Sales].[Customer] ([CustomerID])
ALTER TABLE [Sales].[Store] CHECK CONSTRAINT [FK_Store_Customer_CustomerID]
ALTER TABLE [Sales].[Store] WITH CHECK ADD CONSTRAINT [FK_Store_SalesPerson_SalesPersonID] FOREIGN KEY([SalesPersonID])
REFERENCES [Sales].[SalesPerson] ([SalesPersonID])
ALTER TABLE [Sales].[Store] CHECK CONSTRAINT [FK_Store_SalesPerson_SalesPersonID]
ALTER TABLE [Sales].[Store] ADD CONSTRAINT [DF_Store_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Sales].[Store] ADD CONSTRAINT [DF_Store_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]