| Property | Value |
|---|---|
| Name | vProductModelInstructions |
| ID | 1963154039 |
| Schema | Production |
| Owner | dbo |
| Encrypted |
|
| Schema Bound |
|
| With Check Option |
|
| ANSI NULLS |
|
| Uses Quoted Identifier |
|
| Has Opaque Metadata |
|
| Published |
|
| Schema Published |
|
| Replicated |
|
| Has Replication Filter |
|
| Has Unchecked Assembly Data |
|
| Date Correlation View |
|
| Uses Database Collation |
|
| Tracked by CDC |
|
| MS Shipped |
|
| Modify Date | 8/8/2010 5:23:46 PM |
| Create Date | 8/8/2010 5:23:46 PM |
| 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. |
| Column Name | Datatype | Nullable | Is Identity |
|---|---|---|---|
| ProductModelID | int |
|
|
| Name | Name |
|
|
| Instructions | nvarchar(max) |
|
|
| LocationID | int |
|
|
| SetupHours | decimal(9,4) |
|
|
| MachineHours | decimal(9,4) |
|
|
| LaborHours | decimal(9,4) |
|
|
| LotSize | int |
|
|
| Step | nvarchar(1024) |
|
|
| rowguid | uniqueidentifier |
|
|
| ModifiedDate | datetime |
|
|
| 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' |