Avatar of yonbret
Flag for United States of America asked on

SQL Server permission problem - External Application can't execute stored proc in another database

We have an Accounting software that uses a SQL Server back-end. When certain events occur in the Accounting software, we want the Accounting software to execute a stored procedure. The stored procedure is in the Accounting SQL Server database, but makes updates to another SQL Server database called dbCofA.

When we execute the stored procedure directly from the SQL Server management studio, everything runs great. When we attempt to execute it from the Accounting software we get the following message:

Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server] The server principal "sa" is not able to access the database "dbCofA" under the current security

The accounting software company is telling us that the stored procedure should be executed from their software using an Application Role. We are both confused as to why the message states that the sa account is being used. Both the Application Role and the sa account have permissions to update the dbCofA database.

Any ideas how to get this to work?
Microsoft SQL ServerSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon
Nakul Vachhrajani

It appears that the connection to the database is being made by the application using the "sa" user.

Can you review the connection strings in your application? The connections should be a non-sa user (your DBA should be able help with what this user should be).
Raja Jegan R

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

I am working with the Accounting software company to see the details of the connection string. I will return to this questions as soon as I receive a response from them.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy