OPENXML with INSERT

  • Hi,

    I have SQL 2005 ENT on Windows 2003 server and try to insert XML data into a table variable:

    '

    '

    I know following statement does not work since RequestID and AppName are differnt level from RequestPeopleID, Login, Passwork, TaskID and Status:

    INSERT INTO @Request(RequestID, AppName, RequestPeopleId, Login, Password, TaskID, Status)

    SELECT RequestID, AppName, RequestPeopleId, Login, Password, TaskID, Status

    FROM OPENXML (@idoc, '/R/A/RP', 2)

    WITH (RequestID INT '../@RequestID'

    ,AppName VARCHAR(50) '../@AppName'

    ,RequestPeopleId VARCHAR(30) '@RequestPeopleId'

    ,Login VARCHAR(100) '@Login'

    ,Password VARCHAR(30) '@Password'

    ,TaskID INT '@TaskID'

    ,Status BIT '@Status')

    Is there a work around? Thanks for any hint.

    Chris

  • Your XML didn't make it accross. Can you make it accessible on a URL?

    ML

    ---
    Matija Lah, SQL Server MVP
    http://milambda.blogspot.com

Viewing 2 posts - 1 through 1 (of 1 total)

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