• create temp table that matches the definition of sp_who2

    insert into #temp (columns list) exec sp_who2

    then read on cursors in BOL for exact cursor syntax.