If you’ve moved to Dynamics CRM/365 Online then the likelihood is that you’ve come up against the limitation of not being able to query the SQL database directly to perform
What is great to see with Dynamics 365 is the concept of the Application User. This means that subscribing systems can be connected to external systems using a ‘Service Account’