declare @jb_name nvarchar(128)
declare c cursor fast_forward for
select name from msdb.dbo.sysjobs
open c
fetch next from c into @jb_name
while @@fetch_status = 0
begin
print 'changing : ' + @jb_name + ' ...'
exec msdb.dbo.sp_update_job @job_name = @jb_name, @owner_login_name=N'sa'
fetch next from c into @jb_name
end
close c
deallocate c