Can SQL Function be used to update a column in a table ?

Simple answer is No.

in fact when you try to issue a DML statement it complains:

Invalid use side-effecting operator Insert within a function

This is one of the limitation of SQL server function as defined in books online.
Functions are used to fetch data and stored procedures are ideally suited for all DML operations.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>