XQuery:
DECLARE @x XML = '
<Customize xmlns="http://utsavfashion.com/web/schemas">
<customize_details>
<entityid>876</entityid>
</customize_details>
</Customize>'
SELECT t.c.value('.', 'INT')
FROM @x.nodes('*:Customize/*:customize_details/*:entityid') t(c)
OpenXML:
DECLARE @x XML = '
<Customize xmlns="http://utsavfashion.com/web/schemas">
<customize_details>
<entityid>876</entityid>
</customize_details>
</Customize>'
DECLARE @doc INT, @xmlns VARCHAR(100)
SET @xmlns = '<root xmlns:h="http://utsavfashion.com/web/schemas" />'
EXEC sp_xml_preparedocument @doc OUTPUT, @x, @xmlns
SELECT *
FROM OPENXML(@doc, '//h:Customize/h:customize_details')
WITH (
entityid INT '.'
)
EXEC sp_xml_removedocument @doc
source
share