Drop a User-defined Function

Use the drop function command to drop a user-defined function.

This command drops a function name and any function strings that have been created for it. You cannot drop system functions.

Before you drop the user-defined function, be sure to:
  1. Drop the stored procedure at the primary database using the drop procedure Adaptive Server command.

    Optionally, use the sp_setreplicate or sp_setrepproc system procedure and specify 'false' to disable replication for the stored procedure.

    Follow the guidelines when specifying stored procedures and tables and for replication. See Replication Server Administration Guide Volume 1 > Manage Replicated Functions > Mark Stored Procedures for Replication for details on using sp_setrepproc.

  2. As a precaution, quiesce the system before executing the drop function command. Dropping functions while updates are in process can have unpredictable results.

    See Replication Server Administration Guide Volume 1 > Manage a Replication System > Quiesce Replication Server.

The syntax for the drop function command is:
drop function replication_definition.function

Execute the command on the Replication Server where the replication definition was created.

The following command drops the Stock_receipt user-defined function created in the previously:
drop function Items_rd.Stock_receipt
Related concepts
Specify Stored Procedures and Tables for Replication