declare @string varchar(200),@sql varchar(1000)set @string = '1,2,3,4,5,6'set @sql = 'select code=''' + replace(@string, ',', ''' union all select ''') + ''''exec (@sql)