Thank you for reaching out to us regarding the issue you are facing when fetching data from Dynamics CRM and copying it to a DW. Based on the information you provided, it seems that you are experiencing two issues:
- One of the columns ("LeadId") appears in the preview data in the source of the copy activity, but it is not created in the DW.
- One of the columns is duplicated, creating the original column and its alias ("new_localdeprestacaoid" and "LocalPrestacaoId").
To address the first issue, it is possible that the column is not being created in the DW due to a data type mismatch or a naming conflict. You can try renaming the column in the source query to see if it resolves the issue. Alternatively, you can try explicitly specifying the data type of the column in the source query to ensure that it is created correctly in the DW.
To address the second issue, it is possible that the column is being duplicated due to a naming conflict or an alias conflict. You can try renaming the column in the source query to see if it resolves the issue. Alternatively, you can try explicitly specifying the alias of the column in the source query to ensure that it is created correctly in the DW.
If the above solutions do not resolve the issues, you can try using a staging table to copy the data from Dynamics CRM and then transform the data in the staging table before copying it to the DW. This can help you to identify and resolve any issues with the data before it is copied to the DW.
I hope this helps! Let me know if you have any further questions or concerns.