Various SQL Server error messages occur in multiple screens in Microsoft Dynamics SL

This article helps you fix an issue in which various SQL Server errors occur in multiple screens in Microsoft Dynamics SL.

Applies to:   Microsoft Dynamics SL 2011
Original KB number:   942095

Symptoms

You may receive one of the following error messages in the various screens in Microsoft Dynamics SL:

Error message 1

SQL Server Message 10215 - Invalid object name '<xxxx>..vs_AcctSub'

Error message 2

SQL Server Message 10215 - Invalid object name '<xxxx>..vs_AcctXRef'

Error message 3

System Message 6909 Another process has already added the vs_acctxref item. The program must be terminated

Error message 4

SQL error 229 - INSERT permission was denied on object vs_acctsub

Error message 5

System Message 6908 Another process has already added the vs_acctsub item. The system will automatically Cancel your changes.

Note

In these messages, <xxxx> represents the name of the Microsoft Dynamics SL application database.

This problem occurs if the following conditions are true:

  • The databases are configured to use Windows authentication.
  • You deleted or renamed an application database.

Cause

When the databases are configured to use Windows authentication, six triggers are created in the system database that contain the name of the application database. If an application database is deleted, renamed, or the authentication type is changed from Windows Authentication to SQL Authentication, the triggers that contain the database name remain in the system database.

Resolution

Note

Before you follow the instructions in this article, make sure that you have a complete backup copy of the database that you can restore if a problem occurs.

To resolve this problem, download and then run the rebuild_triggers.sql statement against the system database. To do this, follow these steps:

  1. Download the rebuild_triggers.sql file.

    The following file is available for download from the Microsoft Dynamics File Exchange Server:

    rebuild_triggers.sql
    Release Date: May 21, 2008

    Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

  2. Double-click the rebuild_triggers.sql file, and then connect to the computer that is running SQL Server and that hosts the Microsoft Dynamics SL databases.

  3. Select the system database that you want, and then click Execute.

  4. Exit SQL Server Management Studio.