
Technique: Running the Stored Procedure From an Interactive Session
To troubleshoot an activation stored procedure, you can turn off activation on the queue, and then run the stored procedure from SQL Server Management Studio or the sqlcmd utility. If you run the stored procedure from an interactive session, you can see any errors that are returned by the stored procedure.
However, you might see different results if the security context and database settings are different in the interactive session than when the stored procedure is activated by the Database Engine. Before you run the procedure, do the following:
-
Use EXECUTE AS to set the user for the interactive session to the user specified for activation.
-
Set the options for the session to the database defaults.
For more information, see Internal Activation Context.