View: [AdventureWorks2016CTP3].[Production].[vProductAndDescription]

CollapseAll image

Collapse image View properties


Name  Value 
 Schema   [Production] 
 Owner   [dbo] 
 Creation date   16.11.2015 
 Is schema bound 
 Encrypted   
 ID   1165247206 

Collapse image Creation options


Name Value
QUOTED_IDENTIFIER ON
ANSI_NULLS ON

Collapse image Resultset


Name  Description Data type Max length
ProductID   int 4
Name   [dbo].[Name] 50
ProductModel   [dbo].[Name] 50
CultureID   nchar 6
Description   nvarchar 400
Total: 5 column(s)

Collapse image Indexes


Index  Description  Primary  Unique  Size KB 
[IX_vProductAndDescription]   CultureID, ProductID   576 0

Collapse image 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
Total 5 object(s)

Collapse image Extended properties


Name  Value 
MS_Description Product names and descriptions. Product descriptions are provided in multiple languages.

Collapse image 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

Collapse image See also


List of views