SSIS Integration with Dynamics CRM

Author by Ajay Ravi

SQL Server Integration Services is a component of the Microsoft SQL Server database software that can be used to perform a broad range of data migration tasks. SSIS is a platform for data integration and workflow applications. It features a data warehousing tool used for data extraction, transformation, and loading. 

Pre-requisites:  

  1. Visual Studio 2017 Professional from an MSDN(Microsoft Developer Network) subscription 
  2. SQL Server Data Tools(SSDT for 2017) : https://go.microsoft.com/fwlink/?linkid=2086373 
  3. Kingswaysoft : https://www.kingswaysoft.com/products/ssis-integration-toolkit-for-microsoft-dynamics-crm (Download 64 bit version) 

Download the above software in order as they are dependent on each other. 

Steps to be followed to create a package: 

  1. Open Visual Studio 2017 (SSDT). 

Note: Using Visual Studio with SSDT allows you to use the SQL Server Object Explorer to visually explore tables, views, stored procedures, and many more objects in your SQL Data Warehouse as well as run queries. 

  1. Create a new project: Click File --> New --> Project. 
  2. Navigate to Business Intelligence --> Integration Services --> Integration Service Project and give project name. 

1.png

  1.  Make sure that SSIS toolbox is present in Visual Studio as shown below: 

2.png

If SSIS Toolbox not visible in SSDL, then follow the steps shown in the link: https://www.mssqltips.com/sqlservertip/3615/ssis-toolbox-is-not-visible-in-sql-server-data-tools/ 

https://stackoverflow.com/questions/48102365/missing-ssis-toolbox-in-visual-studio-2017 

 

  1. The next step is to create a connection. Go to control flow-->  There is an option for connection manager below. Right click to create new connection. Click on DynamicCRM and click Add. 

3.png

  1. Authentication and server URLs for Creating a connection: 
  1. Server Endpoint: SOAP 2011 
  2. Authentication type: Online Federation 
  3. CRM Discovery Server: North America 
  4. Provide Username and Password. 
  5. Organization: Select the environment where you want to run this package.  
  6. Click Test connection and if it is successful then click ok. 

4.png

  1. After creating the connection we need to create Dynamic CRM Source and Dynamic CRM Destination. We will insert our FetchXML query or other details at Source and perform necessary operations. 
  2. Click on Data Flow-->Select Dynamic CRM Source and Dynamic CRM Destination from SSIS Toolbox. Drag the arrow in between the source and destination 
  3. Double click CRM Source--> Select the connection we created under connection manager(example of using FetchXML in the below fig). 

5.png

Batch size comes out to be 2000 automatically. Select source type as: 

  1. Entity --> select entity name where you want to perform the operation. 
  2. FetchXML --> Select FetchXML as option and then copy the code below. You can verify the count from XRMToolbox(View Record Count). 
  3. Go to columns and select the Unique Identifier column mentioned. 

 

  1. Double click Destination--> Select connection and the Action which you want to perform such as Create, Update, Delete etc. And select the destination entity which is basically the entity name. Click Ok. 

6.png

 

  1. Package successfully created. Click Save button. 
  2. On the right hand side, go to solution explorer--> SSIS packages --> Package.dtsx (package we created)--> Execute package. 

7.png

Reference: 

  1. https://www.youtube.com/watch?v=5Sr2UrgACGY (Getting Started with SSIS Integration). 
  2. XRMToolbox: FetchXML / View Record Count can be used to get the count before executing the query.