sp_xmL_preparedocument, openxml and xpath

  • I'm trying to do something like this:

    ALTER PROCEDURE [dbo].[InsertProc]

    @Message xml

    AS

    BEGIN

    DECLARE @iTree INTEGER

    EXEC sp_xml_preparedocument @iTree OUTPUT, @Message, '<root xmlns:ns0="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" />'

    INSERT [dbo].[MyTable](

    -- Some fields

    )

    SELECT

    -- More fields

    FROM

    OPENXML(@iTree,'/root',2)

    WITH(

    [ns0:Example] DATETIME 'fn:concat("foo", "bar")',

    )

    END

    The error no mattery what I try is "XML parsing error: Unknown method.". I've tried several namespaces and also different functions, no help.

    Any help is appreciated. 🙂

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply