Indexed View Schemabinding

83 Views Asked by At

I want to create indexed view, any help would be appreciated. I have this:

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

If you have any question let me know...thanks

1

There are 1 best solutions below

0
On

Missed a coma, see

IssuanceDate

should be

,IssuanceDate


Add the table alias in front of:

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

Where tbl is the table where the above information is allocated.

(tbl could differ for the fields, check it!).