SQL Source Control can't access this database - make sure the database is online and you have permission to access it

Besides the causes mentioned in the actual error message (the database being offline or the user used to connect in SSMS not having permissions) this can also be caused by Certificate Validation issues.

If you have started getting this error after upgrading from a version prior than 7.2.0, please note that we've updated the Microsoft.Data.SqlClient library. For security reasons, this library now sets the TrustServerCertificate parameter to a default value of false in more scenarios.

You can either resolve the certificate validation issues on your system or work around this by explicitly setting the "Trust Server Certificate" property to true (available in the SSMS connection dialog options screen).

Was this article helpful?

8 out of 38 found this helpful
Have more questions? Submit a request