view icon View: vProductModelInstructions

Properties

Property Value
Name vProductModelInstructions
ID 1963154039
Schema Production
Owner dbo
Encrypted false
Schema Bound false
With Check Option false
ANSI NULLS true
Uses Quoted Identifier true
Has Opaque Metadata false
Published false
Schema Published false
Replicated false
Has Replication Filter false
Has Unchecked Assembly Data false
Date Correlation View false
Uses Database Collation false
Tracked by CDC false
MS Shipped false
Modify Date 8/8/2010 5:23:46 PM
Create Date 8/8/2010 5:23:46 PM

Extended Properties

Name Value
MS_Description Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel table that has manufacturing instructions.

View Columns

Column Name Datatype Nullable Is Identity
ProductModelID int false true
Name Name false false
Instructions nvarchar(max) true false
LocationID int true false
SetupHours decimal(9,4) true false
MachineHours decimal(9,4) true false
LaborHours decimal(9,4) true false
LotSize int true false
Step nvarchar(1024) true false
rowguid uniqueidentifier false false
ModifiedDate datetime false false

Indexes

No view indexes defined.

Object Level Permissions

No object level permissions defined.

Column Level Permissions

No explicit column permissions granted to this object

Objects that depend on [vProductModelInstructions]

Objects on which [vProductModelInstructions] depends

SQL

Script
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE VIEW [Production].[vProductModelInstructions] AS SELECT [ProductModelID] ,[Name] ,[Instructions].value(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"; (/root/text())[1]', 'nvarchar(max)') AS [Instructions] ,[MfgInstructions].ref.value('@LocationID[1]', 'int') AS [LocationID] ,[MfgInstructions].ref.value('@SetupHours[1]', 'decimal(9, 4)') AS [SetupHours] ,[MfgInstructions].ref.value('@MachineHours[1]', 'decimal(9, 4)') AS [MachineHours] ,[MfgInstructions].ref.value('@LaborHours[1]', 'decimal(9, 4)') AS [LaborHours] ,[MfgInstructions].ref.value('@LotSize[1]', 'int') AS [LotSize] ,[Steps].ref.value('string(.)[1]', 'nvarchar(1024)') AS [Step] ,[rowguid] ,[ModifiedDate] FROM [Production].[ProductModel] CROSS APPLY [Instructions].nodes(N'declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"; /root/Location') MfgInstructions(ref) CROSS APPLY [MfgInstructions].ref.nodes('declare default element namespace "http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions"; step') Steps(ref);
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Displays the content from each element in the xml column Instructions for each product in the Production.ProductModel table that has manufacturing instructions.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'VIEW',@level1name=N'vProductModelInstructions'

See also

List of Views