pae2
asked on
Can someone algorithmically explain this TSQL UDF with XML?
Can someone please provide an algorithmic description of what this TSQL UDF is doing? I am not familiar with XML for TSQL.
FUNCTION [Common].[XmlArrayOfInt]
(@Xml AS XML (Common.ArrayOfIntegersSch ema))
RETURNS @Result TABLE (Value INT NOT NULL)
AS
BEGIN
INSERT INTO @Result(Value)
SELECT T.c.value('.','int') AS Value
FROM @Xml.nodes('/ArrayOfInt/in t') AS T(c)
RETURN
END
Also are value and nodes built-in TSQL functions? And what is '/ArrayOfInt/int'?
Thanks!
FUNCTION [Common].[XmlArrayOfInt]
(@Xml AS XML (Common.ArrayOfIntegersSch
RETURNS @Result TABLE (Value INT NOT NULL)
AS
BEGIN
INSERT INTO @Result(Value)
SELECT T.c.value('.','int') AS Value
FROM @Xml.nodes('/ArrayOfInt/in
RETURN
END
Also are value and nodes built-in TSQL functions? And what is '/ArrayOfInt/int'?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.