-
Simple question
Hi all,
I'm sure this a dumb question, but...
I have 2 databases set up in MS SQL Server 7. They were imported from Access. In Access, they were linked, but now they no longer are.
How do I re-link them, so that I can see tables from BOTH dbs when creating a new view?
Thanks!
-
You can create a view based on tables from multiple databases. All you need is permission to access tables in both databases.
If you are logged in as sa, then
create view myview as
select t1.column1, t2.column2
from d1.dbo.table1 as t1, d2.dbo.table2 t2
where t1.somecolumn = t2.somecolumn
here d1 and d2 are two databases in the same server.
-
create view myview as
select t1.column1, t2.column2
from d1.dbo.table1 as t1, d2.dbo.table2 t2
where t1.somecolumn = t2.somecolumn
here d1 and d2 are two databases in the same server.
just to add more....
* somecolumn here means the primary key that links the 2 tables...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|