use sybsystemprocs
go

drop table udescriptions              -- Utility Descriptions
go
drop table udboption                  -- Utility Database options & statuses
go
drop table uitype                     -- Utility Index types
go

set quoted_identifier             on
go
set string_rtruncation            on
go

create table udescriptions            -- Data Management by sp_addcomment
  (spname    varchar (30)   not null, --    and sp_dropprocedure
   seq       tinyint        not null,
   objid     int            not null,
   txt       varchar (77)   not null,

   primary key clustered (spname, seq))
go

create table udboption
  (txt_seq   smallint       not null     check (txt_seq > -1),
   dboption  int            not null     check (dboption > -1),
   dboption2 int            not null,
   dboption3 int            not null,
   txt       varchar (29)   not null,

   primary key clustered (txt_seq))
go

create table uitype
  (txt_seq   smallint       not null     check (txt_seq > 0),
   dflt      smallint       not null     check (dflt in (0, 1)),
   type      int            not null,
   type2     int            not null,
   txt       varchar (33)   not null,

   primary key clustered (txt_seq, dflt))
go

insert into udboption values ( 1,     1,      0,      0, 'FAILED UPGRADE!')
insert into udboption values ( 2,   256,      0,      0, 'UNRECOVERABLE!')
insert into udboption values ( 3, 16384,      0,      0, 'RENAMED!')
insert into udboption values ( 5,    64,      0,      0, 'In recovery')
insert into udboption values ( 6,    32,      0,      0, 'Marked unrecoverable')
insert into udboption values ( 7,     4,      0,      0, 'Unlogged operations')
insert into udboption values ( 8,     8,      0,      0, 'Truncate log')
insert into udboption values ( 9,    16,      0,      0, 'No recovery checkpoint')
insert into udboption values (10,   512,      0,      0, 'DDL allowed within xact')
insert into udboption values (11,  1024,      0,      0, 'Read only')
insert into udboption values (12,  2048,      0,      0, 'DBA only')
insert into udboption values (13,  4096,      0,      0, 'Exclusive user')
insert into udboption values (14,  8192,      0,      0, 'NULL column default set')
insert into udboption values (21,     0,      1,      0, 'Abort on full log')
insert into udboption values (22,     0,      2,      0, 'No free space accounting')
insert into udboption values (23,     0,      4,      0, 'Table identity automatic')
insert into udboption values (24,     0,      8,      0, 'Identity in non-unique index')
insert into udboption values (25,     0,     16,      0, 'Offline')
insert into udboption values (26,     0,     32,      0, 'Offline for recovery')
insert into udboption values (27,     0,     64,      0, 'Unique auto_identity index')
insert into udboption values (28,     0,    128,      0, 'Database has suspect pages')
insert into udboption values (29,     0,   1024,      0, 'Online for standby access')
insert into udboption values (30,     0, -32768,      0, 'Non-dedicated log')
insert into udboption values (31,     0,      0,    128, 'Quiesced')
go
update statistics udboption
go
insert into uitype values ( 1,  0, 32768,  0,  'SUSPECT INDEX!')
insert into uitype values ( 2,  0,  2048,  0,  'Primary')
insert into uitype values ( 3,  0,     2,  0,  'Unique')
insert into uitype values ( 4,  0,    16,  0,  'Clustered')
insert into uitype values ( 4,  1,    16,  0,  'Nonclustered')
insert into uitype values ( 5,  0,     1,  0,  'Ignore dup key')
insert into uitype values ( 6,  0,     4,  0,  'Ignore dup row')
insert into uitype values ( 7,  0,    64,  0,  'Allow dup rows')
insert into uitype values (10,  0,     0,  1,  'Supports foreign key constraint')
insert into uitype values (11,  0,     0,  2,  'Supports DRI constraint')
insert into uitype values (12,  0,     0,  4,  'Index includes an IDENTITY column')
insert into uitype values (14,  0,     0, 16,  'Large I/O''s enabled')
insert into uitype values (15,  0,     0, 32,  'MRU cache strategy enabled')
go
update statistics uitype
go

dump transaction sybsystemprocs with truncate_only
go
