title: Cannot create index ... imprecise, computed and not persisted
body: <p>I can can't create an index on this view</p>
  
  <p><code>CCF.UserHistory.NEID</code> is a calculated and persisted column.</p>
  
  <pre><code>CREATE VIEW [Calais].[vwBossDaily]
  WITH SCHEMABINDING
  AS
    SELECT SUM(ISNULL(Score, 0))               AS Score,
           SUM(ISNULL(DivideBy, 0))            AS DivideBy,
           COUNT_BIG(*)                        AS Count,
           ReportDefGroupID,
           ImportDate,
           MetricID,
           ISNULL(Calais.Card.BossNEID, 0)     AS BossNEID,
           ISNULL(CCF.UserHistory.BossNEID, 0) AS BossBossNEID
    FROM   Calais.Card
           INNER JOIN CCF.UserHistory
             ON Calais.Card.BossNEID = CCF.UserHistory.NEID
                AND Calais.Card.ImportDate = CCF.UserHistory.keyDate
    GROUP  BY ReportDefGroupID,
              ImportDate,
              MetricID,
              ISNULL(Calais.Card.BossNEID, 0),
              ISNULL(CCF.UserHistory.BossNEID, 0)
  
  GO
  
  /****** Object:  Index [VIX_Card]    Script Date: 10/24/2013 11:28:01 ******/
  CREATE UNIQUE CLUSTERED INDEX [VIX_Card]
    ON [Calais].[vwBossDaily] ( 
                              [ReportDefGroupID] ASC, 
                              [ImportDate] ASC, 
                              [MetricID] ASC, 
                              [BossNEID] ASC, 
                              [BossBossNEID] ASC )
    WITH (PAD_INDEX = OFF, 
          STATISTICS_NORECOMPUTE = OFF, 
          SORT_IN_TEMPDB = OFF, 
          IGNORE_DUP_KEY = OFF, 
          DROP_EXISTING = OFF, 
          ONLINE = OFF, 
          ALLOW_ROW_LOCKS = ON, 
          ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  
  GO 
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Msg 1901, Level 16, State 1, Line 3<br>
    Cannot create index or statistics 'VIX_Card' on view 'Calais.vwBossDaily' because key
    column 'BossBossNEID' is imprecise, computed and not persisted.<br>
    Consider removing reference to column in view index or statistics key
    or changing column to be precise. If column is computed in base
    table consider marking it PERSISTED there.</p>
  </blockquote>
  
  <p>A simpler repro of the issue is</p>
  
  <pre><code>CREATE TABLE T
  (
  id int,
  BossNEID AS CAST(id as float) PERSISTED
  )
  
  GO
  
  CREATE VIEW V
  WITH SCHEMABINDING
  AS
  SELECT ISNULL(BossNEID, 0) AS BossNEID
  FROM dbo.T  
  GROUP BY ISNULL(BossNEID, 0)
  
  GO
  
  CREATE UNIQUE CLUSTERED INDEX IX ON V(BossNEID) /*Fails*/
  </code></pre>