摘要:
SQL中SPLIT方法 ALTERFUNCTION[dbo].[FN_EC_Split](@RowDatanvarchar(2000),@SplitOnnvarchar(5))RETURNS@RtnValuetable(Idintidentity(1,1),Datachar(4))ASBEGINWhile(Charindex(@SplitOn,@RowData)>0)BeginInsertInto@RtnValue(data)SelectData=ltrim(rtrim(Substring(@RowData,1,Charindex(@SplitOn,@RowData)-1)))Set@R 阅读全文