2014-01-15 111 views
0

我想創建索引視圖,任何幫助,將不勝感激。我有這樣的:索引視圖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 

如果您有任何問題,讓我知道...謝謝

回答

0

錯過了昏迷,看到

IssuanceDate

應該

,IssuanceDate


添加在前面的表的別名:

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

哪裏tbl就是上述信息被分配表。

(tbl可能因字段不同而不同,請檢查它!)。