Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Connect to mutiple databases

Author  Topic 

Mooby
Starting Member

1 Post

Posted - 2005-06-23 : 07:49:59
Hi there,

For an intranet portal I'm developing I need to get data from mutiple databases(Exact database). Because I can only connect to 1 database at a time within my portal, I was wondering if it is possible to create a new database within Enterprise Manager(SQL Server) that has links to the actual databases ealier mentioned. Is this possible? Are there other possibilities that are better with concern to liability/sequrity/scalebilty... and so on?

Tnx!

Gr Mooby

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-06-23 : 08:49:56
Use Stored procedures to call the data accross mutiple BDs.

select col1,col2,col3
from db01.dbo.yourtable

Jim
Users <> Logic
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2005-06-23 : 09:06:04
If they reside on different servers you might also try using somethinglike this:

SELECT G.ID, G.Name
FROM OPENROWSET ( 'SQLOLEDB', '000.0.0.00(use the IP Address of the server you want to connect to here)' ; 'UserName' ; 'Password', 'select * from DatabaseName.dbo.TableName') as G

I don't know performance wise what the best practice is, but this is a handy code chunk for connecting to databases on other servers.

Aj
Go to Top of Page
   

- Advertisement -