Hello, i am getting the same error, My SQL server is 2017 and from my build server i am connect fine using SSMS and ODBC, i can also seen on the SQL Server logs that there is a failed login attempt:
"Login Failed with user 'fred'. Reason: Failed to open the explicitly specified database 'MYDB' : [CLIENT: xx.xx.xxx.xx] Ip of the build server
Any ideas?