Execute a stored procedure as another user permission
问题 I faced the following problem: there's a user who has to execute a stored procedure (spTest). In spTest's body sp_trace_generateevent is called. sp_trace_generateevent requires alter trace permissions, and I don't want user to have it. So I would like user to be able to execute spTest. How can I do that? 回答1: Try this: EXECUTE AS user = 'special_user' EXECUTE YourProcerdure REVERT see these: Understanding Context Switching <<<has examples of things like you are trying to do Understanding