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 Error 916 with custom trigger

(0) ShareShare
ReportReport
Posted on by 170

 Hi all

I am tring to create a trigger on batch table. The trigger will fire at the time when batch is posted and it will wite some data to another SQL database (non-solomon) on the same server. I got the following error when I tried to do the post:
 
The server principal "07718158D19D4f5f9D23b55dbf5df1" is not able to access the database "abc" under the current security context.
 
I check this login on sql server and of course has no right to "abc" database. I grant the rights and I am still getting the same error. 

I worte a similar trigger when the AP vouchere is released and I don't have any problem at all. The ap release stored procedure and the gl post stored procedure are running with excute as the above sql user. I don't know why I can get AP to work but the the GL trigger. 
 
The environment I am working on is V7FP1 with sql login. The database is SQL 2005 with compatibility level  set to 90 (SQL2005).

Thanks!

 

abby wang

*This post is locked for comments

I have the same question (0)
  • microsoftdynamicsforums.com Profile Picture
    245 on at

     In my environment I got the similar message but for "master60sp" user. I got this:

    The server principal "master60sp" is not able to access the database "TEST" under the current security context.

     I provided master60sp user rights to access TEST database and it worked.

     You may want to run the "Synchronize All Ownership and Security" DB Update scenario, and see what happens.

     Rohtash Kapoor
     http://www.MicrosoftDynamicsForums.com

     

     

     

  • abby wang Profile Picture
    170 on at

    I've tried your suggestion and it is not working because my destination db is non-Solomon database, so the "Cynchronize all ownership and security" won't fit into my environment. The user "Master60sp" doe have proper rights to the destination database, but I am still getting the error when POSTING the batches. (The post batch stored procedure is executed under sql user '077...' )

    The only way I can get this to work is to change db owner of my destination db to "Master60sp". However, I really don't like this solution because it is not a Solomon database.

     

    Abby

  • microsoftdynamicsforums.com Profile Picture
    245 on at

     Is Master60SP the db_owner of your SL database?

  • abby wang Profile Picture
    170 on at

     

    Yes, master60sp is the db owner of all SL databases. Can it be something else than master60sp? I remembered I tried that too a while ago and it made things even worse.

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