Load data from XML file to Azure SQL DB using Azure data factory

amikm 11 Reputation points
2022-01-10T15:58:13.763+00:00

I am trying to load the XML file (adf.xml) from blob storage to Azure SQL DB

From the attached file (mappingadfxml1.pdf), I am only looking for the columns that are checked and loaded into the respective columns in Azure SQL DB.

I have also attached the sample data (sampledatainfinaltable.txt) as my final output of what I am expecting

I was getting some issues with the structure so that I thought If we can create a temp table first to load the data from XML and then write a SQL script or stored procedure to fit the data into the final table in the desired format.

163658-sampledatainfinaltable.txt

163615-adf.xml[163616-mappingadfxml1.pdf][3]

163759-aaamappingadf.xml

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2022-01-11T13:35:40.797+00:00

    Hi @amikm ,

    Thank you for posting query in Microsoft Q&A Platform.

    In Copy activity, under mappings tab we can define mappings between source and sink columns. To get mappings under copy activity mappings tab, make sure your source and sink datasets has schema imported OR you can import schema directly under mappings tab as well.

    Click here to know more about Schema and data type mapping in copy activity.

    If your XML is not allowing to import mappings correctly to map columns between source and sink then as you said you can consider loading data to temp table and from there to actual table as well.

    Between, feel free to share more details about issues which you are facing with structure.

    Hope this will help. Please let us know if any further queries.

    -----------------

    Please consider hitting Accept Answer button. Accepted answers helps community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.