Hi everybody,

I would like to know if is it true that we can not execute a system stored procedure within a trigger?
If this is true, so how can I run the sp_revokedbaccess in a trigger inside a table that stores all the my application's users...
My problem is: when I delete a user through the application, I have to remove its user from the database... So I have created a trigger to run the sp_revokedbaccess, but when I run this comand:

delete from users where name = 'username'

It generates this error:

Server: Msg 15002, Level 16, State 1, Procedure sp_revokedbaccess, Line 26
The procedure 'sp_revokedbaccess' cannot be executed within a transaction.

How can I fix this?
If someone can help me, I'll be very grateful...