SqlServer2008 - Can I Alter a Scalar Function while it is referenced in many places
- by Casey C.
We have a scalar function that returns a DateTime. It performs a couple of quick table selects to get its return value. This function is already in use throughout the database - in default constraints, stored procs, etc. I would like to change the implementation of the function (to remove the table hits and make it more efficient) but apparently I can't do that while it is referenced by other objects in the database.
Will I actually need to update every object in the database that references it to remove the reference, update the function and then update all those objects to restore the reference to the function?
Thanks for any insight you can give.