In SQL Server, it’s possible to update data via a table-valued function.
What I mean is, you can update data in the underlying tables that the function queries.
For example, if your function returns someone’s first name from a table, you can update their first name by running an UPDATE
statement against the function instead of the table.
Note that this only works on inline table-valued functions (ITVFs). As far as I’m aware, it won’t work on multi-statement table-valued functions (MSTVFs).
Also, the columns you update will need to be valid columns in the function’s query.
Continue reading →