Writing database queries across different services

Posts   
 
    
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 28-Feb-2013 19:39:27   
SELECT
    *
FROM
    tbl_order o
INNER JOIN
    tbl_contact c
ON
    c.ContactId = o.BillingContactId

The above query for an e-commerce store is nice and simple.

If I were to move all of my contacts data into a CRM such that its stored in a different database and the e-commerce database references contacts via a guid and fetches their data via a WCF service, how would I create an equivalent query?

Would this be too slow and ought I instead keep a copy of the contacts data in the e-commerce database?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 01-Mar-2013 12:34:40   

I vote against copying the contacts data. Was it proved to be slow calling the WCF service?

Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 01-Mar-2013 12:39:54   

I haven't tried it yet. How would the equivalent query be written?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 02-Mar-2013 07:09:08   

Ian wrote:

I haven't tried it yet. How would the equivalent query be written?

I don't understand that question. I mean: if you have two tables on different DBs and you access the 'contact' table with a service, then I only can think on running your SELECT 'tbl_order', then with those contact_id you should look for them in the other service and do a lookup text/combo in your GUI. Am I missing something?

David Elizondo | LLBLGen Support Team
Ian avatar
Ian
User
Posts: 511
Joined: 01-Apr-2005
# Posted on: 02-Mar-2013 11:28:04   

I guess not. I wasn't sure whether there was a fancier way of doing it.