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)
 Setup linked server with database name.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-29 : 10:08:18
Kevin writes "I want to be able to write T-SQL stored procedures which refer to objects in another database, on another machine without having to specify both the server name and the database name. I want to do this because the machine which holds the SQL Server database changes from multiple development environments to testing environments to live. Also, usually the name of the database changes.

I have setup a linked server and this solves the changing server problem, but I would really like to specify the database in the linked server so that I dont have to refer to it explicitly in my T-SQL as follows:

linkedServerName.databaseName.dbo.tableName

Is it possible to setup the linked server so that I can refer to remote database objects like:

linkedServerName..dbo.tableName

or something similar?

I am using SQL Server 2000 running on Windows 2000 and need to refer to both SQL Sever 2000 and SQL Server 7 databases.

Any help is much appreciated!"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-11-29 : 19:07:27
I guess you would be able to do it with Dynamic SQL



Damian
Go to Top of Page

IrishDevil
Starting Member

1 Post

Posted - 2001-11-30 : 07:49:25
quote:

I guess you would be able to do it with Dynamic SQL



Damian



I dont really want to use dynamic SQL as I would still need to specify a database (which would have to be identified from somewhere), and ideally I would like to be able to specify/change the database using Entprise Manager or some suitable GUI.


Go to Top of Page
   

- Advertisement -