get data from remote DB, using a list of customers locally -
07-19-2006
, 02:16 PM
I have a sqlserver 2000 db that contains a list of customers (~200) and
products codes(~700). There is a DB2 database (that I only have read
access to) that stores sales for all customers and all products (there
are a lot of each). What I would like to do is retrieve sales ONLY for
the customers and products that are on my sql server.
Obviously if the data was all on the same database I could just join on
the tables, but of course it isnt possible as they are two completely
different DBs.
There are too many of both the products and the customers in an IN
list, although I suppose I could split it down into chunks.
I could also do it using a loop and ADO, looping through each customer
and product before dumping into the local database. Although this
would mean performing 140,000 queries, which might not go down too
well. Again I suppose I could group up the products and put them in an
IN list.
There is too much data to retrieve it all and then discard what I dont
need.
I feel like I am missing something obvious here.
Anyone any suggestions?
Thanks in advance
Kevin |