ALTER FUNCTION
changes a scalar, inline table-valued, or multi-statement table-valued function
What changes
- Input
- module body (its own statements and their sources)
- Output or change
- module definition
Syntax at a glance
ALTER FUNCTION [ schema_name. ] function_name ( [ { @parameter_name [ AS ][ type_schema_name. ] parameter_data_type [ = default ] } [ ,...n ] ] ) RETURNS return_data_type [ WITH <function_option> [ ,...n ] ] [ AS ] BEGIN function_body RETURN scalar_expression END [ ; ]
Work example
A function needs a reviewed behavior or return-shape change.
List callers, permissions, schema binding, dependencies, and boundary inputs before replacing the definition.
Check your work All callers compile and the new function passes normal, empty, and NULL test cases.
Open Microsoft Learn for full syntax, permissions, and details for your version.