fetch person into @id, @name
select * from #formatted
drop table #formatted
--This is pretty much textbook for bad sql - but if you only need to to this once I wouldn't worry about it. If you need to do this regularly, there are better performing methods than the cursors such as cycling through a table variable.
create function OSList(@ID integer)
declare @ReturnValue varchar(500)
select @ReturnValue = isnull(@ReturnValue + ', ', '') + OS
where ID = @ID
order by OS
If it's not practically useful, then it's practically useless.