• wrote:

    A, so you are forced to specify it. It is not possible to call all fields without specifying (*) (inside ITEM) and get every column back as you call a table.

    DesNorton wrote:

    Use something like this, and change your data types as needed

    SELECT 
    id = XT.XC.value('(id/text())[1]', 'int')
    , bezeichnung = XT.XC.value('(bezeichnung/text())[1]', 'varchar(20)')
    , typ = XT.XC.value('(typ/text())[1]', 'varchar(20)')
    , typvalue = XT.XC.value('(typvalue/text())[1]', 'int')
    , stock = XT.XC.value('(stock/text())[1]', 'int')
    , lange = XT.XC.value('(lange/text())[1]', 'decimal(8,2)')
    , breite = XT.XC.value('(breite/text())[1]', 'decimal(8,2)')
    , abld_s = XT.XC.value('(abld_s/text())[1]', 'decimal(18,16)')
    FROM
    @MyXMLString.nodes('/items/item') AS XT(XC)

    A, so you are forced to specify it. It is not possible to call all fields without specifying (*) (inside ITEM) and get every column back as you call a table.

     

    Other question is, why are you using TEXT() in the syntax.. Is this to transform the value always in text format?