• paul.morgan-1069605 (11/2/2011)


    Thanks for all of this it was exactly what I was trying to solve. I'm using the XQUERY and have all good results except one particular node format.

    The node looks like:

    <ProductID ProductNo="100086861"></ProductID>

    I'd be happy to get the full string but really only need that number.

    Using the XQUERY approach can that be done?

    Thanks for your time.

    P

    (Using SQL Server 2008 R2)

    DECLARE @xml xml = '<ProductID ProductNo="100086861"></ProductID>';

    SELECT @xml.value('/ProductID[1]/@ProductNo', 'int');


    [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]