Northwind Database (Document! X Sample)
AdventureWorks Database / Production Schema / Production.Location Table
In This Topic
    Production.Location Table
    In This Topic
    Description
    Product inventory and manufacturing locations.
    Properties
    Creation Date27/10/2017 14:33
    File GroupPRIMARY
    Text File Group
    System Object
    Published for Replication
    Rows14
    Data Space Used8.00 KB
    Index Space Used24.00 KB
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
    Primary Key Primary key for Location records.SmallInt2   
     Location description.dbo.Name50   
     Standard hourly cost of the manufacturing location.Currency8 
    ((0.00))
     
     Work capacity (in hours) of the manufacturing location.Numeric9 (8,2) 
    ((0.00))
     
     Date and time the record was last updated.DBTimeStamp4 
    (getdate())
     
    Indexes
    IndexDescriptionPrimaryUnique
    Unique nonclustered index. 
    Primary key (clustered) constraint
    Check Constraints
    NameDescriptionExpression
    Check constraint [Availability] >= (0.00)
    ([Availability]>=(0.00))
    Check constraint [CostRate] >= (0.00)
    ([CostRate]>=(0.00))
    Relationships
    RelationshipDescription
    Foreign key constraint referencing Location.LocationID.
    Foreign key constraint referencing Location.LocationID.
    Objects that depend on Production.Location
     Database ObjectObject TypeDescriptionDep Level
    Production.ProductInventory tableProduction.ProductInventoryTableProduct inventory information.2
    dbo.ufnGetStock functiondbo.ufnGetStockUser Defined FunctionScalar function returning the quantity of inventory in LocationID 6 (Miscellaneous Storage)for a specified ProductID.3
    Production.WorkOrderRouting tableProduction.WorkOrderRoutingTableWork order details.1
    Objects that Production.Location depends on
     Database ObjectObject TypeDescriptionDep Level
    dbo.Name datatypedbo.NameUser Defined Data Type 2
    SQL
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [Production].[Location](
        [LocationID] [smallint] IDENTITY(1,1) NOT NULL,
        [Name] [dbo].[Name] NOT NULL,
        [CostRate] [smallmoney] NOT NULL,
        [Availability] [decimal](8, 2) NOT NULL,
        [ModifiedDate] [datetime] NOT NULL,
     CONSTRAINT [PK_Location_LocationID] PRIMARY KEY CLUSTERED 
    (
        [LocationID] 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 [Production].[Location] ADD  CONSTRAINT [DF_Location_CostRate]  DEFAULT ((0.00)) FOR [CostRate]
    ALTER TABLE [Production].[Location] ADD  CONSTRAINT [DF_Location_Availability]  DEFAULT ((0.00)) FOR [Availability]
    ALTER TABLE [Production].[Location] ADD  CONSTRAINT [DF_Location_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
    ALTER TABLE [Production].[Location]  WITH CHECK ADD  CONSTRAINT [CK_Location_Availability] CHECK  (([Availability]>=(0.00)))
    ALTER TABLE [Production].[Location] CHECK CONSTRAINT [CK_Location_Availability]
    ALTER TABLE [Production].[Location]  WITH CHECK ADD  CONSTRAINT [CK_Location_CostRate] CHECK  (([CostRate]>=(0.00)))
    ALTER TABLE [Production].[Location] CHECK CONSTRAINT [CK_Location_CostRate]
    See Also