VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. How to drop a function in SQL
Programming Blog

Atom/RSS Feed

sql

How to drop a function in SQL

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;
Join my mailing list