--将给定的逗号分隔的数字字符串转换为Table CREATE FUNCTION [dbo].[fu_Split](@strString nvarchar(4000)) RETURNS @Result TABLE(Value int) AS BEGIN DECLARE @x xml SELECT @x = CAST(‘<A>‘ + REPLACE(@strString,‘,‘,‘</A><A>‘) + ‘</A>‘ AS xml) INSERT INTO @Result SELECT t.value(‘.‘,‘int‘)AS inVal FROM @x.nodes(‘/A‘)AS x(t) RETURN END
时间: 2024-10-25 14:34:32