USE msdb;

IF OBJECT_ID('tempdb..#out') IS NOT NULL
BEGIN;
  DROP TABLE #out;
END;

SELECT      s.name AS JobName,
            l.name AS JobOwner,
            [s].[enabled],
            'EXEC dbo.sp_manage_jobs_by_login
@action = N''REASSIGN'',
@current_owner_login_name = N''' + l.name + ''',
@new_owner_login_name = N''SA'';' AS sql
  INTO      #out
  FROM      dbo.sysjobs s
  LEFT JOIN master.sys.syslogins l
    ON [s].[owner_sid] = [l].[sid]
 WHERE      l.[name] <> 'sa'
 ORDER BY l.name;

RETURN;
