Introduction

In this article, we’ll explore two common methods for creating staging tables and migrating data to Dynamics 365 Customer Engagement (D365): using SQL Stored Procedures and Azure Data Factory (ADF) Data Flows**. This comparison highlights the pros and cons of each approach, focusing on execution time, cost, and suitability for data migration projects.

Scenario: Migrating D365 Case Records

Case records

We are tasked with migrating 5 test Dynamics 365 (D365) cases (incident entity) from a Source SQL database. Key attributes of D365 Case records include lookups and optionsets, which need to be resolved before migration.

SQL

Once these references are obtained, we can build a staging table to prepare the data for migration.

Resolving References and Creating Staging Table

Before migrating records to D365, we need to create a staging table by joining the source table with various D365 reference tables. Two common methods to achieve this.

Staging table

Option 1. Using SQL Stored Procedure

Source

Option 2. Using ADF Data Flow

Performance Comparison: Execution Time

Cost Comparison: ADF Pricing

Let’s examine the cost of running these pipelines based on Azure pricing (as of July 2020).

Key Takeaways

Conclusion

While ADF Data Flow offers a no-code approach to data transformation, the execution time and associated costs make SQL Stored Procedures a better option for most data migration tasks, especially when dealing with large volumes of data in Dynamics 365 projects.