• Your XML doesn't show up, also I think WITH "tablename" will only pick up attributes.

    Either change to this

    INSERT ID SELECT * FROM OPENXML(@docHandle, N'/IDs/ID') WITH (ID char(4) 'text()')

    or use the 'nodes' function

    INSERT ID

    SELECT r.value('.','char(4)') AS ID

    FROM @xmldocument.nodes('/IDs/ID') AS x(r)

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537