COMMIT in OPENXML????

  • Does OpenXML automatically COMMITs the records

    ie., if i am entering 20 records in one go, when will COMMIT occur.

    Is it after each RECORD or after 20 records.

    My problem is..

    INSERT INTO TABLEAA (ID, NAME)

    SELECT (SELECT MAX(ID) + 1 FROM TABLEAA), NAME FROM OPENXML(@ptr, '/RECORDS/RECORD', 2) WITH (NAME VARCHAR(30))

    Only one ROW is affected...

    The error thrown is Primary KEY Violated.

    i want to do it in Single Querry... is it possible...

    THNX

  • I am not sure because I think .NET XML classes are better but try this link read the article and click on figure one to fix your code.  Hope this helps.

    http://msdn.microsoft.com/msdnmag/issues/05/06/DataPoints/default.aspx

    Kind regards,

    Gift Peddie

    Kind regards,
    Gift Peddie

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

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