Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:35:41+00:00 2026-05-29T18:35:41+00:00

I have .MAP file which is created from SAS XML mapper. As the name

  • 0

I have .MAP file which is created from SAS XML mapper. As the name suggest, the file is derived from XML file. Now I want to insert data from this file in to SQL server 2008 tables. The .MAP file contains data for almost 28 tables. Is there any way to import such a huge data?

This is the sample of .MAP file. The file is too large to share so I am just adding a part of the file to provide some basic idea but can not share actual file.

<?xml version="1.0" encoding="UTF-8"?>
<!-- ############################################################ -->
<!-- 2012-02-10T13:13:14 -->
<!-- SAS XML Libname Engine Map -->
<!-- Generated by XML Mapper, 902000.3.6.20090116170000_v920 -->
<!-- ############################################################ -->
<!-- ###  Validation report                                   ### -->
<!-- ############################################################ -->
<!-- XMLMap validation completed successfully. -->
<!-- ############################################################ -->
<SXLEMAP name="AUTO_GEN" version="1.2">

<!-- ############################################################ -->
<TABLE name="Patients">
    <TABLE-DESCRIPTION>Patients</TABLE-DESCRIPTION>
    <TABLE-PATH syntax="XPath">/Patients</TABLE-PATH>

    <COLUMN name="Patients_ORDINAL" ordinal="YES">
        <INCREMENT-PATH beginend="BEGIN" syntax="XPath">/Patients</INCREMENT-PATH>
        <TYPE>numeric</TYPE>
        <DATATYPE>integer</DATATYPE>
    </COLUMN>

</TABLE>

<TABLE name="Patient">
    <TABLE-DESCRIPTION>Patient</TABLE-DESCRIPTION>
    <TABLE-PATH syntax="XPath">/Patients/Patient</TABLE-PATH>

    <COLUMN name="Patients_ORDINAL" ordinal="YES">
        <INCREMENT-PATH beginend="BEGIN" syntax="XPath">/Patients</INCREMENT-PATH>
        <TYPE>numeric</TYPE>
        <DATATYPE>integer</DATATYPE>
    </COLUMN>

    <COLUMN name="Patient_ORDINAL" ordinal="YES">
        <INCREMENT-PATH beginend="BEGIN" syntax="XPath">/Patients/Patient</INCREMENT-PATH>
        <TYPE>numeric</TYPE>
        <DATATYPE>integer</DATATYPE>
    </COLUMN>

    <COLUMN name="PatientID">
        <PATH syntax="XPath">/Patients/Patient/PatientID</PATH>
        <TYPE>numeric</TYPE>
        <DATATYPE>integer</DATATYPE>
    </COLUMN>

</TABLE>
</SXLEMAP>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:35:47+00:00Added an answer on May 29, 2026 at 6:35 pm

    Given your input sample, you could “shred” that XML into relational data (rows and columns) with something like this:

    DECLARE @input XML = '<?xml version="1.0" encoding="UTF-8"?>
    <SXLEMAP name="AUTO_GEN" version="1.2">
    <TABLE name="Patients">
        <TABLE-DESCRIPTION>Patients</TABLE-DESCRIPTION>
        <TABLE-PATH syntax="XPath">/Patients</TABLE-PATH>
    
        <COLUMN name="Patients_ORDINAL" ordinal="YES">
            <INCREMENT-PATH beginend="BEGIN" syntax="XPath">/Patients</INCREMENT-PATH>
            <TYPE>numeric</TYPE>
            <DATATYPE>integer</DATATYPE>
        </COLUMN>
    
    </TABLE>
    
    <TABLE name="Patient">
        <TABLE-DESCRIPTION>Patient</TABLE-DESCRIPTION>
        <TABLE-PATH syntax="XPath">/Patients/Patient</TABLE-PATH>
    
        <COLUMN name="Patients_ORDINAL" ordinal="YES">
            <INCREMENT-PATH beginend="BEGIN" syntax="XPath">/Patients</INCREMENT-PATH>
            <TYPE>numeric</TYPE>
            <DATATYPE>integer</DATATYPE>
        </COLUMN>
    
        <COLUMN name="Patient_ORDINAL" ordinal="YES">
            <INCREMENT-PATH beginend="BEGIN" syntax="XPath">/Patients/Patient</INCREMENT-PATH>
            <TYPE>numeric</TYPE>
            <DATATYPE>integer</DATATYPE>
        </COLUMN>
    
        <COLUMN name="PatientID">
            <PATH syntax="XPath">/Patients/Patient/PatientID</PATH>
            <TYPE>numeric</TYPE>
            <DATATYPE>integer</DATATYPE>
        </COLUMN>
    
    </TABLE>
    </SXLEMAP>'
    
    
    SELECT
        TableName = Map.Tbl.value('@name', 'varchar(50)'),
        TableDescription = Map.Tbl.value('(TABLE-DESCRIPTION)[1]', 'varchar(50)'),
        TablePath = Map.Tbl.value('(TABLE-PATH)[1]', 'varchar(50)'),
        ColumnName = Map2.Col.value('@name', 'varchar(50)'),
        ColumnPath = Map2.Col.value('(PATH)[1]', 'varchar(50)'),
        ColumnIncrementPath = Map2.Col.value('(INCREMENT-PATH)[1]', 'varchar(50)'),
        ColumnType = Map2.Col.value('(TYPE)[1]', 'varchar(50)'),
        ColumnDataType = Map2.Col.value('(DATATYPE)[1]', 'varchar(50)')
    FROM
        @input.nodes('/SXLEMAP/TABLE') AS Map(Tbl)
    CROSS APPLY 
        Map.Tbl.nodes('COLUMN') AS Map2(Col)
    

    This will give you an output something like:

    TableName  TableDescription TablePath         ColumnName        ColumnPath           ColumnIncrementPath    ColumnType  ColumnDataType
    Patients   Patients         /Patients         Patients_ORDINAL  NULL           /Patients    numeric integer
    Patient    Patient          /Patients/Patient Patients_ORDINAL  NULL           /Patients    numeric integer
    Patient    Patient          /Patients/Patient Patient_ORDINAL   NULL           /Patients/Patient    numeric integer
    Patient    Patient          /Patients/Patient PatientID         /Patients/Patient/PatientID NULL    numeric integer
    

    Extending that approach, you should be able to fully parse the XML and put it into a intermediate, relational format, which you can then use to go on from there (and put the data where it belongs, in the end)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that I would like to map some attributes of
I have a piece of java code which reads strings from a file and
I have created a C++/CLI mixed DLL which I am using from C# Winforms
I have created a non-copyable map which I cannot get to compile with clang.
I am trying to map a drive using a batch file. I have tried:
In my spring application context file, I have something like: <util:map id="someMap" map-class="java.util.HashMap" key-type="java.lang.String"
I have map.resources :posts and I want to be able to serve post bodies
I have a Map which is to be modified by several threads concurrently. There
I have taken thumbnail image from gallery which is smaller in size and resized
I have a JSON file which is populated to an activity (Main.java). This Activity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.