on 04-17-2014 5:25 PM
Hello,
I need some help. I need data from 2 tables with the same name on different SQL servers thru an ODBC connection. When I try to get the data by adding both to my datasource I get data from one or the other. I have considered creating a view, but not sure how to handle this. Thanks.
Hi,
Linked Servers are pretty simple and straightforward, just do a search for the procedure.
I do have an additional comment, though. Depending on what tables you're gathering, I've found noticeable differences in performance when I use a connector to a DB on Server Instance "A" linked to "B" versus Server Instance B linked to A. I haven't determined the circumstances affecting one over the other.
If I'm not happy with speed using a connector A, I try switching to B. I like to use as much SQL code as possible, but you can't get around the connector still being a factor.
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Dru,
have you looked into creating a Linked Server system?
after setting that up you can create a Command object off of the main connection (a Command object allows for free hand sql as opposed to adding tables from your db) and then use transact sql in the Command for a union query between the two tables.
in the link above there is some syntax on creating a query using a linked server system.
-jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.