Link to home
Create AccountLog in
Avatar of yonbret
yonbretFlag 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
context.

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?
Avatar of Nakul Vachhrajani
Nakul Vachhrajani
Flag of India image

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).
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of yonbret

ASKER

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.