DECLARE @RowCount INT

SET @RowCount = (SELECT COUNT(ID) FROM Table1)

DECLARE @I INT

SET @I = 1

WHILE (@I 0

BEGIN

INSERT INTO Table2 (base, part) VALUES (@word, SUBSTRING(@word,1,@len))

SET @len=@len-1

END

SET @I = @I + 1

END

Similar questions and discussions