Help is needed. Function local.name (.) Xquery

Can someone tell me how the local.name (.) Xquery function works. about the problem with sql-building, I ask a question on the forum and they give me an answer. where the local.name (.) xquery function is used, but the syntax is not very clear to me.

;with cte as
(
select x.i.value('local-name(.)','nvarchar(MAX)') as colname
,x.i.value('.','nvarchar(max)') as data
from @x.nodes('/Record/DELETED/*') as x(i))

what is the meaning of this line xivalue ('local-name (.)', 'nvarchar (MAX)') as colname, why is' local-name (.) "what is the local name (.) what does this mean. again xivalue ('.', 'nvarchar (max)') as data, please explain the two lines in detail. I am not an advanced user. Many thanks.

please guide me. thank

+3
source share
1 answer

local-name(.) node node. local-name (..), node node.

x.i.value('.','nvarchar(max)') node.

@x.nodes('/Record/DELETED/*') /Record/Deleted.

, / /Record/Deleted.

+7

All Articles