Dropping a stored procedure properly
I have accidently deleted a store procedure from the sysobjects table by issuing the delete command. I should have dropped the stored procedure but instead of droppping it, I have deleted the stored procedure. I have tried to update the sysobjects table using the similar store procedure name which has been deleted, but the following error prompt out: "Procedure 'testing' has already been created with group number 1 - create procedure with an unused group number." What can I do to fix this problem?

    Requires Free Membership to View

    When you register, my team of editors will also send you resources covering Linux administration and management; integration and interoperability between Linux, Windows and Unix; securing Linux and mixed-platform environments; and migrating to Linux.

    Margie Semilof, Editorial Director

    By submitting your registration information to SearchEnterpriseLinux.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchEnterpriseLinux.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

You cannot delete a stored procedure from SYSOBJECTS system table unless you change the configuration setting of ASE by using sp_configure 'allow updates', 1. To do that, you need to be Sybase system administrator. It is better not to delete from system catalogue tables unless it is absolutely necessary. The proper way of dropping a stored procedure is to issue the following command:

DROP procedure <PROCEDURE_NAME >

This was first published in March 2006