Altering User-Defined Functions Definition

To modify the definition of a user-defined function, you can use the ALTER FUNCTION statement in exactly the same way you use the CREATE FUNCTION statement. In this case, the new definition replaces the old definition of the user-defined function with the same name.

Listing 10.23 shows an example of how to use the ALTER FUNCTION statement to modify a preexisting user-defined function and encrypt the definition with the WITH ENCRYPTION option.

Code Listing 10.23. Use ALTER FUNCTION to Modify a User-Defined Function
					 USE Northwind GO -- Returns the maximum ProductID from Products ALTER FUNCTION dbo.MaxProductID ...

Get Microsoft® SQL Server™ 2000 Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.