OPENXML

  • Comments posted to this topic are about the item OPENXML

  • Thanks for the interesting example of what happens when you mix attribute-centric and element-centric mapping in one xml structure.

  • The use of XQuery would be better vs. OPENXML which is generally considered to be obsolete. It is more readable which helps to avoid errors.

    Additionally, OPENXML is a resource hog. See the SQLServerCentral article:

    http://www.sqlservercentral.com/blogs/michael_coles/archive/2008/01/20/stop-using-openxml-please.aspx


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

  • Answering Carla's question directly - try the following:

    SELECT

    *

    FROM OPENXML (@hdoc, '/test/value',3)

    WITH (id int,

    name varchar(10),

    class int,

    flag char(1))

    i.e. the flags Argument can be a combination of Byte Values (1 (attribute-centric) and 2 (element-centric))

Viewing 4 posts - 1 through 3 (of 3 total)

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