Knowledge Base

PRB: Xp_sendmail with Query May Cause Deadlocks in SQLMail

Article ID: 164999

Article Last Modified on 11/14/2003


APPLIES TO


This article was previously published under Q164999

SYMPTOMS

If you run the extended stored procedure xp_sendmail with the optional @query parameter, and the query calls xp_sendmail or causes it to be run with a trigger again, the client process deadlocks with itself and cannot be killed.

CAUSE

The SQLMail extended stored procedures are serialized, and can only be run one at a time.

WORKAROUND

To work around this problem, make sure that the @query parameter does not call xp_sendmail again, and that if data modification is done in the query, xp_sendmail is not called by triggers on the effected tables.

MORE INFORMATION

In this situation, neither the original connection nor the loopback connection made by SQLMail can be killed. However, the client can cancel the query.

Additional query words: block

Keywords: kbprb kbusage KB164999