--/////////
Methode 1
drop table #TempTbl;
DECLARE @Str NVARCHAR(MAX) = N'1, 2, 3, 4, 5, 6, 7'
DECLARE @sql_xml XML = Cast('<K>'+ Replace(@Str, ',', '</K><K>')+ '</K>' AS XML)
SELECT f.x.value('.', 'varchar(max)')[ID] INTO #TempTbl FROM @sql_xml.nodes('/K') f(x)
drop table #TempTbl;
--///////// Methode 2
declare @TempTbl TABLE (ID int identity(1,1),Value NVARCHAR(MAX))
//////Result
No comments:
Post a Comment