We have a lot of multi-statement TVFs and we sometimes want to convert these to be inline TVFs (usually for performance reasons).
We can't do a simple ALTER FUNCTION to make this switch because SQL Server tells us "Cannot perform alter on 'db.FOO' because it is an incompatible object type." so we have to drop the function first and then recreate it.
This has worked well for us, but we aren't sure why SQL Server doesn't just do the drop/create automatically. Is there some particular issue that it's trying to protect us from that we're blindly walking in to?
Some Google searching reveals people getting the error message and being told to just drop it and recreate it, but I haven't been able to figure out the why of the error message in the first place.
Any insight into the internals would be appreciated.