Benutzer mit den meisten Antworten

Index on View

Frage

Cannot create the clustered index 'IX_TPiDs' on view 'Schema1.dbo.View_Tbl_A' because the select list of the view contains an expression on result of aggregate function or grouping column. Consider removing expression on result of aggregate function or grouping
column from select list.

Please see my view definition (it created fine)

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE view [dbo].[View_Tbl_A] With Schemabinding
AS
SELECT TPID,
Client,
PFN + ' ' + PLN AS [PN],
PFTIN,
PFax,
MFN + ' ' + MLN AS [MN],
MCC AS [MID],
Count_Big(*) AS Cnt
FROM Tbl_A
WHERE TPID IS NOT NULL
GROUP BY TPID,Client,PFN,PLN,PFTIN,PFax,
MFN,MLN,MCC
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO