declare @a nvarchar(100) = 'abbccc'; with a as(select 1 n union all select n+1 from a where n