use master
declare @allow_update int
select @allow_update = value from syscurconfigs
        where config = 102
if (@allow_update = 0)
begin
        select config_admin(1, 102, 1, 0, NULL, NULL)
end
go
if exists (select 1
           from sysobjects
           where sysstat & 7 = 4
             and name = "sp_jst_instmsg")
begin
        drop procedure sp_jst_instmsg
end
go
print "Installing sp_jst_instmsg"
go

set nocount on
go
create procedure sp_jst_instmsg
        @msg_num        int,
        @msg_text       varchar(255)
as
        declare @description varchar(255)

        select @description = description from sysmessages where
                error = @msg_num and langid is null

        if @description = @msg_text
                return 1

        if @description is not null
                delete sysmessages where error = @msg_num

        if @msg_text is null
                return 2

        insert sysmessages values
                (@msg_num, 0, 0, @msg_text, null, null)

        return 0
go

exec sp_jst_instmsg 19048, "Procedure %1!, parameter %2! was not supplied, NULL, or empty."
go
exec sp_jst_instmsg 19123, "%1! value of %2! is invalid."
go
exec sp_jst_instmsg 19124, "Backup for database %1! on %2! failed."
go
exec sp_jst_instmsg 19125, "Database %1! successfully backed up on %2!."
go
exec sp_jst_instmsg 19126, "UPDATE STATISTICS command for table %1! failed."
go
exec sp_jst_instmsg 19127, "UPDATE STATISTICS command for table %1!, index %2! failed."
go
exec sp_jst_instmsg 19128, "UPDATE STATISTICS command for table %1! succeeded."
go
exec sp_jst_instmsg 19129, "UPDATE STATISTICS command for table %1!, index %2! succeeded."
go
exec sp_jst_instmsg 19130, "Threshold values not exceeded so UPDATE STATISTICS did not run for table %1!."
go
exec sp_jst_instmsg 19131, "Cannot delete statistics for table %1!."
go
exec sp_jst_instmsg 19132, "Cannot recompile stored procedures and triggers for table %1!."
go
exec sp_jst_instmsg 19133, "Invalid metadata cache type, value must be Databases (0), Indexes (1), or Objects (2)."
go
exec sp_jst_instmsg 19134, "There are no indexes associated with table %1! for which to reclaim space."
go
exec sp_jst_instmsg 19135, "NUMBER OF MINUTES is required when RESUME option is specified."
go
exec sp_jst_instmsg 19136, "REORG RECLAIM SPACE for table %1!, index %2! failed."
go
exec sp_jst_instmsg 19137, "REORG RECLAIM SPACE for table %1!, index %2! succeeded."
go
exec sp_jst_instmsg 19138, "REORG RECLAIM SPACE for table %1! failed."
go
exec sp_jst_instmsg 19139, "REORG RECLAIM SPACE for table %1! succeeded."
go
exec sp_jst_instmsg 19140, "number of locks changed to %1!."
go
exec sp_jst_instmsg 19141, "Adaptive Server version %1! does not support dynamically changing the memory allocation method."
go
exec sp_jst_instmsg 19142, "Cannot reconfigure user connections."
go
exec sp_jst_instmsg 19143, "UPPER BUFFER PERCENTAGE value for number of user connections was not supplied, NULL, or empty."
go
exec sp_jst_instmsg 19144, "LOWER BUFFER PERCENTAGE value for number of user connections was not supplied, NULL, or empty."
go
exec sp_jst_instmsg 19145, "User connections reconfigured to %1!."
go
exec sp_jst_instmsg 19146, "Not enough space to run REORG REBUILD command on table %1!."
go
exec sp_jst_instmsg 19147, "Transaction log backup for database %1! failed on %2!."
go
exec sp_jst_instmsg 19148, "Transaction log backup for database %1! succeeded on %2!."
go
exec sp_jst_instmsg 19240, "Transaction log dump for database %1! was skipped because row and time thresholds of %2! and %3! were not met."
go
exec sp_jst_instmsg 19406, "Current datachange value of %1! for table %2!, columns/indexes %3!, partition %4! does not meet or exceed the datachange threshold."
go
exec sp_jst_instmsg 19407, "Datachange threshold is only applicable for ASE 15.0 and later.  This value is being ignored."
go
drop proc sp_jst_instmsg
go
sp_configure "allow updates", 0
go
