索引视图架构

时间:2014-01-15 21:13:49

标签: view indexed schemabinding

我想创建索引视图,任何帮助将不胜感激。我有这个:

ALTER VIEW vwCF WITH SCHEMABINDING
as  
SELECT
ftt.FTSName
,cf.FTSTypeID
,ftt.SortOrder
,cf.SecTypeID
,st.SecTypeName
,st.SortOrder
IssuanceDate
,Issuance
,Principal
,Interest
,FlowAmounts
,Net
 FROM dbo.CashFlow AS cf
 INNER JOIN dbo.FinancialType AS ftt ON cf.FTSTypeID = ftt.FTSTypeID
 INNER JOIN dbo.SecType AS st ON cf.SecTypeID = st.SecTypeID
 Go

如果您有任何疑问,请告诉我......谢谢

1 个答案:

答案 0 :(得分:0)

错过了昏迷,请参阅

  

IssuanceDate

应该是

  

,IssuanceDate


在前面添加表别名:

,tbl.IssuanceDate
,tbl.Issuance
,tbl.Principal
,tbl.Interest
,tbl.FlowAmounts
,tbl.Net

其中tbl是分配上述信息的表。

(tbl可能因字段而异,请检查!)。