schemabinding problem

From: marcmc (marcmc_at_discussions.microsoft.com)
Date: 03/07/05


Date: Mon, 7 Mar 2005 08:01:10 -0800

I want to index a view. The view was not scema bound. I copied view data to
temp table and attempted to drop the view and rebuild as like so with the
following error?
Is it possible to cross database schemabind?

CREATE VIEW GEv_lu_Lookup WITH SCHEMABINDING AS
SELECT Ge_lookup_id, Ge_source_id, Ge_lookup_code, Ge_lookup_desc
FROM DbName1.dbo.GEt_lu_Lookup
UNION
SELECT Ge_lookup_id, Ge_source_id, Ge_lookup_code, Ge_lookup_desc
FROM DbName2.dbo.GEt_lu_Lookup o
WHERE NOT EXISTS
   (SELECT Ge_lookup_id, Ge_source_id, Ge_lookup_code, Ge_lookup_desc
    FROM DbName1.dbo.GEt_lu_Lookup i
    WHERE i.Ge_lookup_id = o.Ge_lookup_id
    AND i.Ge_source_id = o.Ge_source_id
    AND i.Ge_lookup_code = i.Ge_lookup_code)

Server: Msg 4512, Level 16, State 3, Procedure GEv_lu_Lookup, Line 3
Cannot schema bind view 'GEv_lu_Lookup' because name
'DbName1..GEt_lu_Lookup' is invalid for schema binding.
Names must be in two-part format and an object cannot reference itself.