I have installed an ODBC driver (system DSN) on a SQL server to connect to an external database. It uses SSL encryption. In SSMS I am able to query it using a linked server and openquery(). In C# code I can query it using a connection string with the DSN. Both of these methods fail when I schedule them as a job in SQL agent with the error message "Failed to decrypt data: Key not valid for use in specified state"

Do I need to grant permission to the SQL agent to be able to use this ODBC connection? How do I do that?

  • What ODBC driver and linked server security settings? Test changing the SQL Agent Service Account or running a Powershell job step with an Agent proxy account. Aug 7 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.