> Is there any way to end (commit/rollback) a transaction inside a stored
> function?
Currently not, but you can RAISE EXCEPTION to terminate the containing
transaction. This will essentially rollback the transaction when it hits
the COMMIT statement (or implied version).
Best Wishes,
Chris Travers