I am trying to create an indexed view in SQL Server 2012 on a query that has 10 joins (inner and left), which is accessed a lot.
However, when attempting to create the view, I get an error:
Cannot schema bind view 'vw_transaction' because name 'entity_event'
is invalid for schema binding.
I am (attempting to) create the view using:
CREATE VIEW vw_transaction WITH SCHEMABINDING AS
Select ee.id as entity_event_id,
....
Is there a reason for this error? It looks like it's a reserved word, as the error mentions a 'name', as opposed to a column. Entity_event
is the name of my main table.
question from:
https://stackoverflow.com/questions/24226584/cannot-schema-bind-view-myname-because-name-mytable-is-invalid-for-schema-bindi 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…