dump tran sybsystemprocs with truncate_only
go

use sybsystemprocs
go

if exists (select * from sysobjects where name = "sp_ioa" and type = 'P')
   drop proc sp_ioa
go

create procedure sp_ioa 
as
select convert(char(3),uid) "uid",
       convert(tinyint,spid) "spid",
       loginame=convert(char(11),suser_name(suid)),
       convert(char(7),physical_io) "io's",
       cmd,
       dbname=convert(char(7),db_name(dbid)),
       convert(char(7),hostname) "host",
       convert(char(7),cpu) "cpu",
       blk=convert(char(3),blocked)
  from master..sysprocesses
  where cmd not like 'AWAITING%'
 order by loginame,spid 
go

if object_id('sp_ioa') is not null
begin
    print '<<< Created procedure dbo.sp_ioa >>>'
    grant execute on dbo.sp_ioa to public
end
else
begin
    print '<<< Failed creating proc dbo.sp_ioa >>>'
end
go