all groups > sql server programming > april 2004 >
You're in the

sql server programming

group:

creating view WITH SCHEMABINDING


creating view WITH SCHEMABINDING Babu
4/29/2004 11:42:05 PM
sql server programming:
hi all,

I have a problem in creating a view with schemabinding
for data across multiple databases from multiple instance
of SQL Server 2000.

But when i create a a view with schemabinding in the same
database it works fine..



create view dbo.VWUSERINFOSM WITH SCHEMABINDING
as
Select SMID, EMAILADDRESS, PASSWORD
from

HERCULUS.SMAUTHENTICATION.SMILEMILE."SML_TBLLOGIN"

error:

Server: Msg 4512, Level 16, State 3, Procedure
VWUSERINFOSM, Line 3
Cannot schema bind view 'dbo.VWUSERINFOSM' because
name 'SMAUTHENTICATION.SMILEMILE.SML_TBLLOGIN' is invalid
for schema binding. Names must be in two-part format and
an object cannot reference itself.
-------------------------------
create view dbo.VWUSERINFOSM WITH SCHEMABINDING
as
Select SMID, EMAILADDRESS, PASSWORD
from
SMILEMILE."SML_TBLLOGIN"

-------------------------------

please suggest me about solution to this problem

Re: creating view WITH SCHEMABINDING Babu
4/30/2004 2:00:19 AM

my applicaton has 3 database as follows,
1. User
2. Administrator
3. Authentication

The relations in authentication is used in all
other databases i prefer we can work with all of databses
by linking using extended stored procedure
sp_addlinkedserver.

Alternatively I wanted to try an approach having views (
schemabinded ) in other related database.
since schema binded views can be indexed.

let me know your approach as well.

-Babu



[quoted text, click to view]
Re: creating view WITH SCHEMABINDING Steve Kass
4/30/2004 3:19:36 AM
I believe you are not allowed to schemabind a view that has a reference
outside the current database. What are you trying to do that needs this?

SK

[quoted text, click to view]
AddThis Social Bookmark Button