Skip to main content
Inspiring
September 15, 2017
Question

Insert XML into SQL Server database

  • September 15, 2017
  • 2 replies
  • 1312 views

Hi,

I need to insert an xml file data into a SQL Server database table using Cold Fusion 11.

I have an SSIS package on the SQL Server that inserts the data.

Is there a way to execute the SSIS package in Cold Fusion?

Is there a SQL statement to insert the data with out using the SSIS package in Cold Fusion?

Thanks in advance,

Mike

    This topic has been closed for replies.

    2 replies

    October 5, 2017

    Process XML data using OPENXML function

    USE OPENXMLTesting

    GO

    DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX)

    SELECT @XML = XMLData FROM XMLwithOpenXML

    EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML

    SELECT CustomerID, CustomerName, Address

    FROM OPENXML(@hDoc, 'ROOT/Customers/Customer')

    WITH

    (

    CustomerID [varchar](50) '@CustomerID',

    CustomerName [varchar](100) '@CustomerName',

    Address [varchar](100) 'Address'

    )

    EXEC sp_xml_removedocument @hDoc

    GO

    Learn more scenarios by learning SQl Server Course !!

    Carl Von Stetten
    Legend
    September 22, 2017

    I don't think you can execute an SSIS package from ColdFusion.  Why can't you just execute the package from SSIS?

    userCold9Author
    Inspiring
    September 22, 2017

    Hi,

    I need to validate the data sent into the application by inserting the data into a table and checking the information against another table.

    The process would let the individuals know of any issues with the data sent.

    Thanks,

    Mike