SQL Server Indexed View syntax for joined DB

indexing, sql-server, view

Solution

In order to create an indexed view your base tables must reside within the same database.

Consult the following Microsoft Books Online reference for further details:

http://msdn.microsoft.com/en-us/library/ms191432(SQL.90).aspx

Problem

I'm trying to set up an index on a VIEW of mine. First error was 1939, Schema Binding required. Ok, no problem with that. ``` ALTER VIEW xyz WITH SCHEMABINDING AS abc ``` Now, in this VIEW I'm using one local table [dbo].][ReleantTable] and two joined tables from other databases on the same server: OtherDbName..OtherRelevantTable Altering the VIEW fails, stating OtherDbName..OtherRelevantTable is invalid for schema binding. I guess it's just an syntax issue. Could anyone get me hint how to address my OtherDb?

Original source