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.

5
  • 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
  • Note that the target SQL Server is external and is exposed as an IP/FQDN on a VPN tunnel. I have no ability to change it's configuration ( such as server name or instance name ). Server : server.env.domain.com,1433
    – BaltoStar
    Commented Jun 24 at 12:45
  • The other app is an Azure Linked Service that relies for its connectivity on a Self-Hosted Integration Runtime (SHIR) installed on the on-premises server. I don't know how to find the connection-string the SHIR constructs to make connections. Within the Azure Linked Service the parameters specified are server, database, username, password.
    – BaltoStar
    Commented Jun 24 at 21:06
  • The way SHIR works is that cloud SHIR has network access to all endpoints that the SHIR server has access to. That's why I'm testing with SSMS on the SHIR server.
    – BaltoStar
    Commented Jun 25 at 12:28

1 Answer 1

1

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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