Solved

How do I query a remote db within my local MS SQL 2008 Studio envirnoment?

Posted on 2009-05-04
2
269 Views
Last Modified: 2012-05-06
I connected to a remote db (192.xxx.xxx.xxx) vua VPN and added that db in my local studio environment.  I know how to connect to a different db...

select from testdb.dbo.test_table (etc)

My code to select from the remote db is:

select * from [192.xxx.xxx.xxx]..testdb.dbo.test_table

Is stating I have too many prefixes.  I know this is simple but short on time and would apprciate any help on this.

Thx
0
Comment
Question by:Glen_D
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
prachwal earned 500 total points
ID: 24299586
create linked server
http://msdn.microsoft.com/en-us/library/ms188279.aspx
and
http://msdn.microsoft.com/en-us/library/ms190479.aspx


select * from linked_name.testdb.dbo.test_table
0
 

Author Closing Comment

by:Glen_D
ID: 31577773
Thx...added the linked server to the local even though I could see everything on the remote db within my envirnment; query worked perfect.

Glen
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
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.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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