Load xml data to sql table

Jefferson-2765 486 Reputation points
2023-11-27T07:04:32.0833333+00:00

How to do that in tsql or ssis?

Please show me step by step.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,520 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,597 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 35,226 Reputation points
    2023-11-27T07:13:45.14+00:00

    Hi @Jefferson,

    You may follow Import XML documents into SQL Server tables using SSIS packages for details.

    To use T-SQL, you may check below code.

    INSERT INTO T
    SELECT 10, xCol
    FROM    (SELECT *
        FROM OPENROWSET (BULK 'C:\MyFile\xmlfile.xml', SINGLE_BLOB)
    AS xCol) AS R(xCol);
    

    Check https://learn.microsoft.com/en-us/sql/relational-databases/xml/load-xml-data?view=sql-server-ver16

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


0 additional answers

Sort by: Most helpful