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
You cannot modify data inside of a UDF. A scalar-valued UDF returns only one value, where a stored procedure can have numerous OUTPUT parameters. You can use scalar-valued UDFs as the default value for a column in a table.
Open any stored procedure (right-click and choose Modify) From the Menu, choose Edit > Intellisense > Refresh Local Cache.
Use SQL Server Management Studio Select on the plus sign next to the database that contains the function you wish to modify. Select on the plus sign next to the Programmability folder. Select the plus sign next to the folder that contains the function you wish to modify: Table-valued Function.
I assume you are talking about an inline TVF in which case you can use
EXEC sp_refreshsqlmodule 'YourTVF'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With