Loading ...
Sorry, an error occurred while loading the content.

Load Bulk XML file into SQL Server and Parsing it.

Expand Messages
  • Sudhakar
    Hi.. can anyone help me out on how to load a big xml file into sql stored procedure (SQL Server 2k) temporary table. the concern i have is, if the xml file is
    Message 1 of 2 , Nov 17, 2005
    • 0 Attachment
      Hi..

      can anyone help me out on how to load a big xml file into sql stored procedure (SQL Server 2k) temporary table.
      the concern i have is, if the xml file is huge then i cannot load into a memory variable and parse it.
      is there any other way by which i can load the xml and parse it.

      ------------------------------------------------------
      Declare @xmlDoc varchar(8000)
      Declare @iDoc int
      Declare @Message as varchar(500)
      Declare @DateCheck Datetime
      EXEC @xmlDoc = master.dbo.xp_cmdshell 'type C: \PFC\Books.xml'
      EXEC sp_xml_preparedocument @iDoc OUTPUT, @xmlDoc
      SELECT * FROM OpenXML(@iDoc, 'Books/')
      exec sp_xml_removedocument @idoc
      ------------------------------------------------------

      Thanks and regards,
      ~Sudhakar


      ---------------------------------
      Yahoo! FareChase - Search multiple travel sites in one click.

      [Non-text portions of this message have been removed]
    • Ronald Bourret
      Hello, This mailing list is for a product named XML-DBMS, which is Java middleware for transferring data between XML documents and relational databases. The
      Message 2 of 2 , Nov 17, 2005
      • 0 Attachment
        Hello,

        This mailing list is for a product named XML-DBMS, which is Java
        middleware for transferring data between XML documents and relational
        databases. The question you are asking is about using the XML
        capabilities of SQL Server. While somebody on this list might know the
        answer, you would be better off asking this question on a SQL Server
        mailing list.

        -- Ron

        Sudhakar wrote:

        > Hi..
        >
        > can anyone help me out on how to load a big xml file into sql stored procedure (SQL Server 2k) temporary table.
        > the concern i have is, if the xml file is huge then i cannot load into a memory variable and parse it.
        > is there any other way by which i can load the xml and parse it.
        >
        > ------------------------------------------------------
        > Declare @xmlDoc varchar(8000)
        > Declare @iDoc int
        > Declare @Message as varchar(500)
        > Declare @DateCheck Datetime
        > EXEC @xmlDoc = master.dbo.xp_cmdshell 'type C: \PFC\Books.xml'
        > EXEC sp_xml_preparedocument @iDoc OUTPUT, @xmlDoc
        > SELECT * FROM OpenXML(@iDoc, 'Books/')
        > exec sp_xml_removedocument @idoc
        > ------------------------------------------------------
      Your message has been successfully submitted and would be delivered to recipients shortly.