Modifying a function used as a column default in SQL Server
SQL Server will not allow you to modify a function that is bound to the DEFAULT constraint of a column.
Your only option is to remove the constraint before altering the function. (Source)
Since the object is referenced, you cannot modify it. This is what you do:
- Remove the default constraint from the table/column
- Modify the function
- Add the default constraint back