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

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 ...

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