Database reference - AdventureWorks2008

AdventureWorks2008 -  tables -  [Sales].[Store]

Description

Customers (resellers) of Adventure Works products. 

Table properties

namevalue
name[Sales].[Store]
createdMar 19 2009 9:09PM
modifiedMar 19 2009 9:10PM 
ansi nullson 
quoted identifieron 
row count701
Size of data808 kb
Size of indexes80 kb
Maximum size of a single row2,147,483,878 bytes

Columns

columndatatypelengthbytesdefaultnullsPKFKUQcomputedcomment
BusinessEntityIDint104 no  yes  BusinessEntity.BusinessEntityID      no  Primary key. Foreign key to Customer.BusinessEntityID. 
NameName50200 no      no  Name of the store. 
SalesPersonIDint104 yes    SalesPerson.BusinessEntityID      no  ID of the sales person assigned to the customer. Foreign key to SalesPerson.BusinessEntityID. 
Demographicsxmlmax2147483646 yes      no  Demographic informationg about the store such as the number of employees, annual sales and store type. 
rowguiduniqueidentifier3616(newid())no      no  ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. 
ModifiedDatedatetime238(getdate())no      no  Date and time the record was last updated. 

Indexes

namedescriptioncolumncomment
AK_Store_rowguidnonclustered, unique located on PRIMARYrowguidUnique nonclustered index. Used to support replication samples. 
IX_Store_SalesPersonIDnonclustered located on PRIMARYSalesPersonIDNonclustered index. 
PK_Store_BusinessEntityIDclustered, unique, primary key located on PRIMARYBusinessEntityIDClustered index created by a primary key constraint. 
PXML_Store_DemographicsDemographics 

References

name
BusinessEntity
SalesPerson

Referenced by

name
Customer

Foreign key graph

BusinessEntitySalesPersonStoreCustomer

Foreign keys

namecolumnsforeign columnstypecomment
FK_Store_BusinessEntity_BusinessEntityIDBusinessEntityIDBusinessEntity.BusinessEntityID   Foreign key constraint referencing BusinessEntity.BusinessEntityID 
FK_Store_SalesPerson_SalesPersonIDSalesPersonIDSalesPerson.BusinessEntityID   Foreign key constraint referencing SalesPerson.SalesPersonID 

Defaults

default namecolumncomment
DF_Store_rowguidrowguidDefault constraint value of NEWID() 
DF_Store_ModifiedDateModifiedDateDefault constraint value of GETDATE() 

Dependency graph

DF_Store_ModifiedDateDF_Store_rowguidNameStoreAK_Store_rowguidIX_Store_SalesPersonIDPK_Store_BusinessEntityIDPXML_Store_DemographicsProduct Line Sales 2008Sales Order Detail 2008Store Contacts 2008ufnGetContactInformationvStoreWithAddressesvStoreWithContactsvStoreWithDemographics

Objects that [Sales].[Store] depends on

nameobject typedatabaseserverlevel
NametypeAdventureWorks2008SPRING\KATMAI1

Objects that depend on [Sales].[Store]

nameobject typedatabaseserverlevel
Product Line Sales 2008Reportreportserver_katmaiSPRING1
Sales Order Detail 2008Reportreportserver_katmaiSPRING1
Store Contacts 2008Reportreportserver_katmaiSPRING1
ufnGetContactInformationmulti-statement table valued functionAdventureWorks2008SPRING\KATMAI1
vStoreWithAddressesviewAdventureWorks2008SPRING\KATMAI1
vStoreWithContactsviewAdventureWorks2008SPRING\KATMAI1
vStoreWithDemographicsviewAdventureWorks2008SPRING\KATMAI1

Sample rows

BusinessEntityIDNameSalesPersonIDDemographicsrowguidModifiedDate
292  Next-Door Bike Store  279  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  a22517e3-848d-4ebe-b9d9-7437f3432304  10/13/2004 11:15:07 AM 
294  Professional Sales and Service  276  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  b50ca50b-c601-4a13-b07e-2c63862d71b4  10/13/2004 11:15:07 AM 
296  Riders Company  277  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  337c3688-1339-4e1a-a08a-b54b23566e49  10/13/2004 11:15:07 AM 
298  The Bike Mechanics  275  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  7894f278-f0c8-4d16-bd75-213fdbf13023  10/13/2004 11:15:07 AM 
300  Nationwide Supply  286  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  c3fc9705-a8c4-4f3a-9550-eb2fa4b7b64d  10/13/2004 11:15:07 AM 
302  Area Bike Accessories  281  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  368be6dd-30e5-49bb-9a86-71fd49c58f4e  10/13/2004 11:15:07 AM 
304  Bicycle Accessories and Kits  283  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  35f40636-5105-49d5-869e-27e231189150  10/13/2004 11:15:07 AM 
306  Clamps & Brackets Co.  275  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  64d06bfc-d060-405c-8c60-c067fe7c67df  10/13/2004 11:15:07 AM 
308  Valley Bicycle Specialists  277  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  59386b0c-652e-4668-b44b-4e1711793330  10/13/2004 11:15:07 AM 
310  New Bikes Company  279  <StoreSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey"><Ann...  47e4b6bd-5cd1-45a3-a231-79d930381c56  10/13/2004 11:15:07 AM 

Code

CREATE TABLE [Sales].[Store](
    [BusinessEntityID] [int] NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [SalesPersonID] [int] NULL,
    [Demographics] [xml](CONTENT [Sales].[StoreSurveySchemaCollection]) NULL,
    [rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
    [BusinessEntityID] [int] NOT NULL,
    [Name] [dbo].[Name] NOT NULL,
    [SalesPersonID] [int] NULL,
    [Demographics] [xml](CONTENT [Sales].[StoreSurveySchemaCollection]) NULL,
    [ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Store_BusinessEntityID] PRIMARY KEY CLUSTERED 
(
    [BusinessEntityID] 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_BusinessEntity_BusinessEntityID] FOREIGN KEY([BusinessEntityID])
REFERENCES [Person].[BusinessEntity] ([BusinessEntityID])
ALTER TABLE [Sales].[Store] CHECK CONSTRAINT [FK_Store_BusinessEntity_BusinessEntityID]
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]
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]



Documentation generated by SqlSpec