arrow_back Back to Notebook
sql
sql
January 10, 2019

How to drop a function in SQL

Dropping or deleting a function in SQL is useful for many different scenarios. You might need to drop and re-create or you might not need the function anymore

Basic Drop

This is the bare minimun required to drop a function in SQL

DROP FUNCTION function_name;

Better Drop

Adding IF EXISTS allows you to handle a potential error that would be thrown if the function does not exist (perhaps it has already dropped). It is essentially the equivalent -f in rm -f

DROP FUNCTION IF EXISTS function_name;

Thanks for reading!

John Wiseman

Full-Stack Software Engineer building scalable digital solutions. specializing in modern web technologies and mission-critical systems.

© 2026 Wiseman Systems Pty. Ltd.

Navigation

Start a Conversation

Ready to discuss your next project? Let's build something extraordinary together.

Get in Touch