PRB: SQLMail Functions Hang on MAPI Error

Last reviewed: May 1, 1997
Article ID: Q136869

The information in this article applies to:
  • Microsoft SQL Server, versions 4.21 and 6.0

SYMPTOMS

In Microsoft SQL Server version 6.0, any SQLMail extended stored procedure that you execute hangs indefinitely and does not return any results. This occurd when a MAPI function encounters an error which causes it to present a dialog box to the user. This problem could also affect alert notifications, scheduled backup notifications, and anything else that relies on the SQLMail extended stored procedures.

When this problem occurs, the MSSQLSERVER service may get into a state where it cannot be shut down and the Windows NT machine must be rebooted in order to get SQLMail functionality to work properly again.

CAUSE

Under some circumstances, the current implementation of MAPI will cause a dialog box to appear on the desktop to indicate a MAPI error. When such a MAPI error is encountered while SQLMail is running, it can cause all SQLMail functions to hang until you click the OK button in the dialog box on the SQL Server machine. If the MSSQLSERVER service is running under a user account (or does not have permission to interact with the desktop), the dialog box never appears on the screen and all SQLMail functions hang until SQL Server is restarted (this may require restarting Windows NT if the MSSQLServer service cannot be shut down).

Note, however, that other queries continue to execute normally on the server. Only queries which call a SQLMail extended stored procedure will hang.

The following two conditions are known to cause the MAPI error dialog box (other MAPI errors could potentially cause the same symptoms):

  1. The mail .MMF file is stored on the post office server and the post

        office server is rebooted after SQLMail has been started.
    

  2. The mail .MMF is stored locally and the drive it is stored on runs out

        of disk space.
    

The error message in the MAPI dialog box for both of the above situations is the following (note that other MAPI error messages are possible):

   Mail is unable to save information to your message file. Check that the
   connection to your message file still exists and you have disk space
   available.

WORKAROUND

Identify the MAPI error that is being returned in the dialog box and take the appropriate steps to avoid that error by working with your primary messaging support provider.

In order to see the MAPI dialog box on the server, the SQL Server process must be run in a configuration that allows interaction with the desktop. There are two methods of accomplishing this:

  1. Run SQL Server from the NT command prompt using the following command:

           sqlservr -c
    

  2. Set up the MSSQLServer service to run under the System account with the

        option selected to "Allow service to interact with desktop." You can
        set this option in the Control Panel, Services application.
    

Note that when the SQL Server process is set up to run under the System account, certain steps may be necessary to enable connectivity to the mail post office. These steps are described in Chapter 18 of the SQL Server version 6.0 "Administrator's Companion," and in the Microsoft Knowledge Base article Q118501 - "INF: Troubleshooting SQLMail Problems."


Additional query words: sql6 xp windows nt
Keywords : kbprg SSrvProg SSrvStProc
Version : 4.21 6.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 1, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.