Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SCHEMABOUND Views over multiple databases or servers

3 views
Skip to first unread message

Nick Large

unread,
Nov 12, 2009, 1:48:53 PM11/12/09
to
Hello.

I'd like to use schemabinding on a view that takes its data from multiple
databases. I understand that SQL 2000 is incapable of doing this, does
anyone know if this is possible in 2005 or even 2008 or am I just wishing on
a star?

Thanks in advance, Nick.


Tom Cooper

unread,
Nov 12, 2009, 1:58:39 PM11/12/09
to
No. The SQL 2008 BOL Create View topic says "When you use SCHEMABINDING,
the select_statement must include the two-part names (schema.object) of
tables, views, or user-defined functions that are referenced. All referenced
objects must be in the same database."

Tom

"Nick Large" <msne...@nospam.nospam> wrote in message
news:%23YifJj8...@TK2MSFTNGP05.phx.gbl...

Erland Sommarskog

unread,
Nov 12, 2009, 5:09:47 PM11/12/09
to
Nick Large (msne...@nospam.nospam) writes:
> I'd like to use schemabinding on a view that takes its data from
> multiple databases. I understand that SQL 2000 is incapable of doing
> this, does anyone know if this is possible in 2005 or even 2008 or am I
> just wishing on a star?

To add to Tom's response, yes you are really wishing on a star. Since a
database may be dropped or a backup may be restored, there is no way
that SQL Server would be able to schemabinding across databases.


--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0 new messages