SqlServer2008 - Can I Alter a Scalar Function while it is referenced in many places

Posted by Casey C. on Stack Overflow See other posts from Stack Overflow or by Casey C.
Published on 2010-04-29T22:43:10Z Indexed on 2010/04/29 22:47 UTC
Read the original article Hit count: 442

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql