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. 🙂