Solved

Querying a database in another server from within sql server 2005

Posted on 2007-04-10
2
194 Views
Last Modified: 2010-03-19
Greetings,

I have a sql server 2005 and a sql server 2000 database, and they are on separate serves. On the 2005 database I have added a connection to my 2000 database, and would like to make a query from within the 2005 database to the sql server 2000 database.

The reason for doing this is that I am moving data from one database to another, and ratherthan cluttering up my 2005 database with temp tables, i thought it would be possible to query the 2000 from the 2005 database. What I am not sure on is how to do this, I know how to access another database within the same server, but not across servers.

And I do know that there is tools out there that will do some of this for me, but I do not have a budget for that right now, so any help on this would be appreciated. Thanks.
0
Comment
Question by:JDEE8297
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 18882135
you have to add the linked server name to your sql 2000 server in the query, ie:

select t.* from your2000linkedserver.databasename.username.tablename t
0
 

Author Comment

by:JDEE8297
ID: 18886498
Greetings,

Thanks for the quick reply, as soon as I had put the question up there I ended up figuring it out, but you deserve the points because you did answer my question. So thanks again.

JD
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question