View:
[AdventureWorks2016CTP3].[Production].[vProductAndDescription]
View properties
| Name | Value |
| Schema | [Production] |
| Owner | [dbo] |
| Creation date | 16.11.2015 |
| Is schema bound | ![]() |
| Encrypted | |
| ID | 1165247206 |
Creation options
| Name | Value |
| QUOTED_IDENTIFIER | ON |
| ANSI_NULLS | ON |
Resultset
| Name | Description | Data type | Max length |
| ProductID | int | 4 | |
| Name | [dbo].[Name] | 50 | |
| ProductModel | [dbo].[Name] | 50 | |
| CultureID | nchar | 6 | |
| Description | nvarchar | 400 |
Indexes
| Index | Description | Primary | Unique | Size KB | ||
| [IX_vProductAndDescription] | CultureID, ProductID | ![]() |
576 | 0 |
Objects that [Production].[vProductAndDescription] depends on
| Object name | Object type | Dep level |
| [Production] | Schema | 1 |
| [Production].[Product] | Table | 1 |
| [Production].[ProductDescription] | Table | 1 |
| [Production].[ProductModel] | Table | 1 |
| [Production].[ProductModelProductDescriptionCulture] | Table | 1 |
Extended properties
| Name | Value |
| MS_Description | Product names and descriptions. Product descriptions are provided in multiple languages. |
SQL
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE VIEW [Production].[vProductAndDescription] WITH SCHEMABINDING AS -- View (indexed or standard) to display products and product descriptions by language. SELECT p.[ProductID] ,p.[Name] ,pm.[Name] AS [ProductModel] ,pmx.[CultureID] ,pd.[Description] FROM [Production].[Product] p INNER JOIN [Production].[ProductModel] pm ON p.[ProductModelID] = pm.[ProductModelID] INNER JOIN [Production].[ProductModelProductDescriptionCulture] pmx ON pm.[ProductModelID] = pmx.[ProductModelID] INNER JOIN [Production].[ProductDescription] pd ON pmx.[ProductDescriptionID] = pd.[ProductDescriptionID]; GO EXEC sp_addextendedproperty N'MS_Description', N'Product names and descriptions. Product descriptions are provided in multiple languages.', 'SCHEMA', N'Production', 'VIEW', N'vProductAndDescription', NULL, NULL GO SET ANSI_PADDING ON GO CREATE UNIQUE CLUSTERED INDEX [IX_vProductAndDescription] ON [Production].[vProductAndDescription] ([CultureID], [ProductID]) ON [PRIMARY] GO SET ANSI_PADDING OFF GO EXEC sp_addextendedproperty N'MS_Description', N'Clustered index on the view vProductAndDescription.', 'SCHEMA', N'Production', 'VIEW', N'vProductAndDescription', 'INDEX', N'IX_vProductAndDescription' GO |
See also