<pre>
dump tran sybsystemprocs with truncate_only
go

use sybsystemprocs
go

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

create procedure sp_io 
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
 order by loginame,spid
go

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