Split string and get row number / index by using string_split in >= SQL Server 2016
declare @name nvarchar(max) = ‘test.d.f.g.hf.ddddd’ declare @items table( id int identity(1,1) not null , part nvarchar(max) ); insert into @items (part) select [value] from string_split(@name, ‘.’) where rtrim([value]) <> ”; select * from @items This