DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2006
    Posts
    1

    SQL2000 remote SQL query

    we are trying to execute a remote sql query from one sql server against another. Both servers are in the same domain. The query is a simple select * from tablename where surname = whatever. We precede this with an 'opendatasource' statement. The query returns only a few rows. When we run the query between two sql servers on the same lan segment the query runs in a second or two. When we run the query between servers on two different network segments (seperated by a firewall) but still both in the same domain the same query takes 50+ seconds to run. Looking further, it seems that the query is actually being executed on the local server so the entire table (over 1 million rows) is copied locally before running the query. How can I run the query as a remote query so that the entire query is run on the remote sql server and only the query results are passed accross the network to the local server? I have also tried creating a linked server and using OPENQUERY but still takes ages to run.

    Thanks

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    The below link contains some tips, although you may have already attempted a couple of them:

    http://www.sql-server-performance.com/linked_server.asp
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. SQL Query on Excel and Access
    By Joey_G in forum Database
    Replies: 3
    Last Post: 04-11-2005, 11:55 AM
  2. Return Query Estimate for SQL Server 2000
    By Daniel Reber in forum Database
    Replies: 0
    Last Post: 09-13-2002, 08:21 AM
  3. SQL Query Fails on NT System
    By Ken D. in forum VB Classic
    Replies: 2
    Last Post: 09-03-2002, 11:25 PM
  4. SQL Query across a network
    By Andy Jackson in forum VB Classic
    Replies: 1
    Last Post: 04-28-2002, 08:41 AM
  5. SQL Query
    By Larry Dodd in forum VB Classic
    Replies: 3
    Last Post: 04-13-2001, 06:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links