0

In SSMS v19 I can successfully connect/login to a SQL server that is listening on the default port 1433

Server : server.env.domain.com,1433
Authentication : SQL Auth

And I can query any of the databases hosted on this server.

Does SSMS reveal the connection-string it is using to make this connection ? I've searched quite a bit and can't find it.

Or is there an API I can call that would return the exact connection string used by SSMS ?

I ask because I am unable to connect via another app located on the same client machine as SSMS. I would like to know exactly how SSMS is making its connection.

9
  • What is the error received when attempting to login in the other app?
    – J.D.
    Commented Jun 24 at 1:55
  • Error is as follows, but note that it does not appear to be a network connectivity issue as both SSMS and this app are located on the same client server. Cannot connect to xxxxxxxxxx. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53) The network path was not found
    – BaltoStar
    Commented Jun 24 at 4:43
  • 1
    This Q&A might help. Commented Jun 24 at 12:21
  • 1
    And what is the connection string being used in the other app?
    – J.D.
    Commented Jun 24 at 12:43
  • 1
    Let's have the full connection string please Commented Jun 24 at 16:38

1 Answer 1

0

SSMS (SQL Server Management Studio) does not directly reveal the exact connection string it uses in its UI. However, you can recreate the connection string by first following these steps to ensure your application is using the same connection parameters:

  1. Check the Connection Properties in SSMS - by right-clicking on the server name in the Object Explorer after connecting to the server. Go to Properties and navigate to the Connection page to see details like server name, connection properties, and authentication type.

  2. Ensure that your other application is configured to use the same network protocols and libraries as SSMS.

  3. Using the SQL Server Configuration Manager, check for any specific configurations or protocols that might be required.

After that you can construct the connection string manually, using the connection parameters collected in the above steps. You can use this link for further info on this SQL Server Connection Strings Reference Guide (mssqltips.com) and SQL Connection Strings tips (sqlshack.com).

Not the answer you're looking for? Browse other questions tagged or ask your own question.