System administrators can write stored procedures that can be executed in any database.
The System Administration Guides include discussions about some system procedures that are relevant to system administration. Many system procedures are explained in this manual, in the sections where they are relevant. For detailed reference information about all procedures, see the Reference Manual: Procedures.
Create a stored procedure in sybsystemprocs and assign it a name that begins with “sp_”. The uid of the stored procedure must be 1, the uid of the database owner.
Most system procedures that you create query the system tables. SAP recommends that you do not create stored procedures that modify the system tables.