Declare @cc char (10), @ i int, @ aa char (20), @ bb int search @ cc = 'Year of the year, @ aa =' 2-36-54-1 ', @ bb = 1, @ i = 1 / * Put the number in the number * / while @BB! = 0 Begin select @ bb = charIndex ('-', @ aa) if @ bb = 0 Break else select @ aa = stuff ( @ aa, @BB, 1, Substring (@ cc, @ i, 1)) set @ i = @ i 1 End Select @AA