SQL Server UDF refresh

sql-server-2005

Solution

I assume you are talking about an inline TVF in which case you can use

EXEC sp_refreshsqlmodule 'YourTVF'

Problem

I have altered the column datatype in one of my tables from int to decimal. I have a UDF referencing the columns of this table. How can I ensure my UDF returns decimals rather than int without having to re-create it? (For view, I know we can use sp_refreshview, not sure about UDF). Thanks, Rashmi

Original source