none
SQL Server 2016 Python Executable Connection Error RRS feed

  • Question

  • Hi, 

    I have a SQL Agent job set up to run a python executable to populate a landing table in SQL Server 2016. This has been working fine for the last 2 years but last week the server hosting my warehouse was upgraded and the warehouse was moved to a new server. Since then the agent job is failing on the python step. 

    The python executable takes in an environment variable from the server with details of the driver, server, database and trusted_connection. I have updated this variable to reflect the name of the new server. 

    If I kick off the Python executable manually on the server the landing table populates as required however if I try run the same executable using:

    • Type: Operating system (CmdExec)
    • Run As: SQL Server Agent Service Account

    I get the following error:

    pyodbc.Error: ('08001', '[08001] [Microsoft][ODBC Driver 13 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [2].  (2) (SQLDriverConnect)').  Process Exit Code -1.

    I have set the MSSQLSERVER and SQLSERVERAGENT as admins on the server. 

    Is there anything else I can do to get this working? Any help will be gratefully appreciated. 

    Kind Regards, 

    Vav


    • Edited by vavacious Tuesday, July 2, 2019 9:30 AM typo
    Tuesday, July 2, 2019 9:29 AM