Use create procedure to create a system ESP in the sybsystemprocs database.
System procedures are automatically included in the sybsystemprocs database. The name of the ESP, and its procedural language function, must begin with “xp_”. The uid of the stored procedure must be 1, the uid of the database owner.
For general information about creating ESPs, see Transact-SQL Users Guide > Using Extended Stored Procedures.