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 Administration (2000)
 Link to other databases

Author  Topic 

ariba2002
Starting Member

2 Posts

Posted - 2004-09-30 : 11:37:58
The followings are the steps that I have done to set up link to other database. First, I created user dsn = MyDBDSN, the DSN is using OLEDB driver for ODBC. Second, I went to security -->LinkedServers-->Add new link server with name MyNewDB, datasource = MyDBDSN, I added useirid and password in security tab. I can see all the tables under that new linked servers but when I run a query on sql analyzer as follow
Select * from MyNewDB.dbo.tableA
, then an error message showed "Invalid object name MyNewDB.dbo.tableA"
Did I miss something? Any input is greatly apreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-30 : 12:35:58
Is the other database on the same server and same instance as the first one? If so, you don't need a linked server. If it isn't (if it's on another server), then you do need a linked server and you need to refer to the object using the 4 part naming convention:

select * from LinkedServerName.DBName.dbo.TableName

Tara
Go to Top of Page

ariba2002
Starting Member

2 Posts

Posted - 2004-09-30 : 12:54:57
the other database is in different server, so yes it needs link server.You pointed out about the4 th name convention, so I realize I forgot to put the database name, once I added it works fine. Thanks alot!
Go to Top of Page
   

- Advertisement -