O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dropping User-Defined Functions

To drop a user-defined function, ,you must use the DROP FUNCTION statement. Listing 10.21 shows a simple example of this statement.

Code Listing 10.21. Use DROP FUNCTION to Delete a User-Defined Function
					
USE Northwind
GO

DROP FUNCTION dbo.Today

Caution

Before dropping a user-defined function, as with any other database object, check its dependencies.

You cannot drop a user-defined function if it is used in a constraint definition. If you drop a user-defined function and it is used in other functions, views, triggers, or stored procedures, those functions will produce an error on next execution.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required