我需要插入查询。也许:
insert tblTestTable (TestData)
select value from STRING_SPLIT((select MyData from tblMyTable), ',')
答案 0 :(得分:0)
类似这样的东西:
CREATE TABLE TableA
(ColumnToSplit VARCHAR(500))
GO
INSERT INTO TableA
SELECT 'A,B,C'
UNION ALL
SELECT 'A,F,G'
UNION ALL
SELECT 'D,E,H'
GO
SELECT value
FROM TableA
CROSS APPLY STRING_SPLIT(ColumnToSplit, ',')
GO