declare @batteryTags nvarchar(2000)='帶鈕釦電池,純鈕釦電池,內置鋰電,音箱,手柄,電子煙,情趣用品(帶鈕釦電池),純鋰電池,移動電源' select SUBSTRING(@batteryTags, number ,CHARINDEX(',',@batteryTags+',',number)-number) as name from master..spt_values s where s.number >=1 and s.type = 'P' and SUBSTRING(','+@batteryTags,s.number,1) = ','