The technology of running external programs on the server side of a relational database management system (RDBMS) has been developed in the past few years. Database 2/ Common Server (DB2/CS) for UNIX-based platforms supports external programs (i.e., user-defined functions and stored procedures) that are written by the application developer in a third-generation language such as C or C++. The main difficulty in debugging these external programs is that they are executed under the control of DB2/CS, which is itself a large software system for which no source code is provided. It is therefore impractical for a debugger to penetrate through the layers of software of DB2/CS to locate and debug the external programs. It is also very difficult for the debugger to determine when an external program will be invoked by the database engine and in which process it will be run. In addition, in an environment where the DB2/CS server is shared between a large number of users, it is necessary to ensure that the debugger does not violate the security of the DB2/CS system. In this paper, we describe a set of extensions to a distributed debugger and DB2/CS to support the debugging of external programs. A prototype was implemented to show the feasibility of the proposed approach.