Q&A about the site for people interested in the history and origins of science and mathematics
declare @S varchar(20) declare @S1 varchar(200) declare @S2 varchar(200) set @S = 'hello/hello/hi/hello' while len(@S) > 0 begin set @S1 = left(@S, charindex('/', @S+'/')-1) set @S2=@S1 if @S1 <> @S2 print @S1 set @S = stuff(@S, 1, charindex('/', @S+'/'), '') end