Hi,
Is it possible in sql server 2005 to make a relation (in diagrams) with
a table of an other database in the same sql server.
ThxNo- FK relationships can't span databases. The nearest you could get is to
separate the tables into schemas in one database and then define the
relationships there.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .|||Paul Ibison schreef:
> No- FK relationships can't span databases. The nearest you could get is to
> separate the tables into schemas in one database and then define the
> relationships there.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
Schemas = diagrams?
So put ereything in one database.
How many tables can you create in 1 database?|||Paul Ibison schreef:
> No- FK relationships can't span databases. The nearest you could get is to
> separate the tables into schemas in one database and then define the
> relationships there.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
Schemas = diagrams?
So put ereything in one database.
How many tables can you create in 1 database?|||No - a schema is just a "container". To all intents and purposes the number
of tables is limited only by the disk space. Each tables belongs to a schema
which itself belongs to a database eg the object PaulsDB.Paul.MyTable
describes a table called "MyTable" in the schema "Paul" in the database
"PaulsDB". So, you could migrate the tables from one database to the other
and change the schema to reflect the fact that it is a different set of
info. Each schema could be placed on a different filegroup also. However all
this is more of an Oracle way of doing things which is perhaps not ideal for
your circumstance. It might be that if the two databases are really strongly
related, you should just have one large database. The most obvious downside
for this is the backup size might prohibit it, and restoring a separate
database obviously won't be possible. So, if the backup policy of a single
database isn't acceptable, I'd implement the relationship constraint using a
trigger.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment