Q:

How to retrieve data from XML column in sql server with no element name

I have XML like this in a column of a SQL Server table:
<Sales>
  <customer>
    <custID>6886903</custID>
    <placeID>143144</placeID>UNKNOWN</customer>

</Sales>

How to retrieve UNKNOWN from above when it doesn't have any element name? 

A:

Actually, the UNKNOWN text belongs to the customer element. 
DECLARE @data XML
SELECT  @data = '<Sales>
  <customer>
    <custID>6886903</custID>
    <placeID>143144</placeID>UNKNOWN</customer>

</Sales>'

SELECT  p.value('(./custID)[1]' , 'int') AS custID,
        p.value('(./placeID)[1]', 'int') AS placeID,
        p.value('(./text())[1]' , 'varchar(max)') AS customerName
FROM    @data.nodes('/Sales/customer') t(p)

