SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Setup linked server with database name.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 11/29/2001 :  10:08:18  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
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!

Australia
4970 Posts

Posted - 11/29/2001 :  19:07:27  Show Profile  Visit Merkin's Homepage  Reply with Quote
I guess you would be able to do it with Dynamic SQL



Damian
Go to Top of Page

IrishDevil
Starting Member

United Kingdom
1 Posts

Posted - 11/30/2001 :  07:49:25  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000