CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 1999
    Location
    Leeds U.K. (Proud to be Sheffield Born)
    Posts
    202

    Querying Across 2 Servers

    Probably very simple, but I can't find the solution on my own...:-)
    I wish to run a simple join select query on two tables in SQL Server 6.5. The problem lies in that the tables in question are identically named and located on different databases on different servers.
    I have tried qualifying the table names with servername.databasename.owner.table, but receive the "maximum prefixes is two" error. Fair enough.
    My intention is to have the Server names and database names passed to vb on the command line (The tables' name does not change), so I cannot perform any design-time tricks like linking the tables into access.
    How can I implement this?
    Thanks people,

    surrendermonkey.

    Colon-Hyphen-Close-Bracket

  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Querying Across 2 Servers

    AFAIK, You cannot query across servers at all.

    You can query across databases though.

    How about copying the table from the one server to the tempdb database on the other server and then comparing them?

    Not efficient for big tables, I'm afraid.

    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Sep 1999
    Location
    Leeds U.K. (Proud to be Sheffield Born)
    Posts
    202

    Re: Querying Across 2 Servers

    Oh.
    Fair enough.
    I suppose I'll just open two connections and force it. It's only three or four thousand records.
    cheers anyway,

    surrendermonkey.

    Colon-Hyphen-Close-Bracket

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured