Most development environments that I have worked in have a developer edition of Microsoft SQL Server on the local machine of the developer. Hence, both the client (SSMS) and the database server are often on the same machine.
What this means is that the default connection mechanism used for all connections will be “Shared Memory”. However, when working on features like auditing, the ability to simulate a TCP/IP connection becomes important. Today, I document a mechanism that you can use to initiate a TCP/IP connection even when both server and client (SSMS) are the on the same machine, provided the server has been configured to allow TCP/IP connections in the Configuration Manager.
When initiating a new connection using the SQL Server Management Studio, simply click on the “Options” button in the “Connect to Database Engine” window, and navigate to the “Connection properties” tab.
In the “Network” group, locate the “Network Protocol” drop-down. Change the value from “<default>” to “TCP/IP“.
Finally, verify the credentials in the “Login” tab and click “Connect“. That’s it!
Use the CONNECTIONPROPERTY() function described in my previous post to confirm that you are indeed connected via TCP/IP.
- Testing your connection strings using SSMS [Link]
- Using CONNECTIONPROPERTY to determine connection properties [Link]
Until we meet next time,
Be courteous. Drive responsibly.