web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

SQL Server Message 916 after detaching and re-attaching the database

(0) ShareShare
ReportReport
Posted on by 185

I have a question regarding an error we saw in SL this morning after detaching and reattaching the SL System and Application databases. We essentially moved the physical location of the database files from our SAN to a local RAID array on our SQL server in an attempt to boost performance. Nothing in the actual database itself was changed. In order to do the move, the SL database was detached, then re-attached to the SQL server. I'm pretty sure the drive letters even stayed the same of the locations of the files.

I tested some SL functionality after the change was made over the weekend and saw no errors. Then this morning we received calls that the Purchase Order screen and Inventory Issues screen would not load, and were throwing error:

SQL Server Message 916

The server principal "07718158D19D4f5f9D23B55DBF5DF1" is not able to access the database "SolomonSystem" under the current security context.

I ran the Syncronize Ownership & Security scenario in Database Maintenance and the error subsided.

What happened here that would have caused this error?

Thanks,

-Mike

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Rachel Moore Profile Picture
    on at

    Hello Mike,

    I did a web search on what could cause that error message and I found the following article:

    support.microsoft.com/.../240872

    In it, it states that "When you move a database from one server that is running SQL Server to another server that is running SQL Server, a mismatch may occur between the security identification numbers (SIDs) of the logins in the master database and the users in the user database. "

    This could be what caused the error.

    As for why the error appeared for the users and not in your functionality testing is not clear.  I can offer you this information, however.  The 077 user which the error is referencing is a non-interactive account used for impersonation.  This id is used when a single stored procedure needs to access objects in the SL System & Application database.

    Perhaps the 077 user was not needed during your testing over the weekend, but SL first called upon the 077 user later.

    I hope this information is helpful to you. I apologize that I could not give you a concrete answer for why this occurs.

  • MNH Profile Picture
    185 on at

    Thanks Rachel!

  • TomMalia Profile Picture
    325 on at

    Just ran into this with some training databases we created by restoring backups of the client's production databases on to the same server.

     

    After running all the Database Maintenance processes several times and dropping and rebuilding a few procs and views manually then doing a lot of Googling, I found that the problem appears to be that the new databases were not "trust worthy" by default. 

    Executing the following seems to resolve the problem for me:

    ALTER DATABASE {APP_DB_NAME_GOES_HERE} SET TRUSTWORTHY ON

    Note though that another possible thing that could cause this problem is if the Dynamics SL "master" user is not the dbo in both the system and application database.  This is Master60SP for Dynamics SL prior to version 2011 and is Master80 for 2011.

    There's a longer story about exactly why having the Master user be the dbo will make this work, but since an SL implementation always as this Login/user and since most of the time that login is the dbo for the databases, just making your databases match that pattern will ensure that you meet one of the necessary criteria for resolving this error.

     


Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans