dump tran sybsystemprocs with truncate_only
go

use sybsystemprocs
go

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

create procedure sp_findmaxvdevno @param char(12) = NULL
as

select max(convert(tinyint, substring(convert(binary(4), d.low), v.low, 1)))
from master..sysdevices d, master..spt_values v

go