Solved

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

Posted on 2009-05-04
2
258 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
replication - alerts? 4 32
Help with SQL - TOP 10 by date and by group 13 34
Ssis not sending failure message 2 10
Alter a column in sql 34 0
     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now