The error message
Invalid use of side-effecting or time-dependent operator in ‘UPDATE’ within a function.
may be found if you try to update any value through SQL Server user defined function (UDF) or even through CLR. To avoid error update should be avoided through any function. A alternate approach is that if you don’t have to use function within query, you can write it as stored procedure.