Enable TCP/IP for SQL Server

Microsoft SQL Server, often simply called SQL Server for short, is one of the three most popular enterprise-class DBMS packages.    This topic is the third step in a five topic sequence showing a complete installation and then utilization of SQL Server 2017 Express from the very beginning.      Please see the Install SQL Server topic for basic info on SQL Server.

 

Disclaimer: These topics were accurate when written, using the versions of installation software indicated.  Third party packages can and do change, so this topic may be out-of-date.  It is provided as an example of how such installations can be approached.

 

Installing SQL Server and readying it for use in typical installations involves five steps:

 

Install SQL Server

 

Open a Firewall Port for SQL Server

 

Enable TCP/IP for SQL Server

 

Create a Database in SQL Server

 

Connect to SQL Server

 

This is the third topic in the above sequence of steps.

 

In this topic, we are using a 64-bit Windows 10 system to which we have connected via Remote Desktop (RDP).  This entire topic was conducted on that machine via RDP.   

Local Connections or Connect through the Network?

If we have Manifold installed on the same computer on which we install SQL Server, and if we will always use our SQL Server installation from the same computer, we can skip this step.  For example, if we are an individual user with only one computer and we do everything on that one computer, we can always connect to SQL Server from Manifold using a localhost designation, that is, not going through any network.

 

We only need to do this procedure if we want to access this SQL Server installation through the network from other computers.  For example, if we work in an organization with several computers and one of them hosts this SQL Server installation but we actually do our Manifold work on a different computer, to connect from our desktop computer to the machine hosting SQL Server we have to be able to connect to it through the web.

Getting Ready

One of the installation tips during the screens shown by the installation dialog in the Install SQL Server topic reminded us that if we will connect to our SQL Server installation from a remote computer we must accomplish prerequisites cited in the Before you get started document.   That document is found in the C:\Program Files\Microsoft SQL Server\140\SSEI\Resources\  folder, as an html file called Before you get started.html - the procedures in this topic and the next topic are guided by the requirements set forth in that file.

Enable TCP/IP for SQL Server

Microsoft's Windows Defender Firewall will prevent connections through the network to SQL Server, so we have first configured the firewall to allow connections in the prior topic, and now we must configure SQL Server to accept such connections by using TCP/IP.  That is easy to do.

 

Launch the SQL Server 2017 Configuration Manager, an application that was automatically installed when we installed SQL Server 2017 Express in the Install SQL Server topic.   That is easiest to do by entering SQL Server 2017 Configuration Manager in the search box for launching commands.  Note that the SQL Server 2017 Configuration Manager is a relatively simple application, and is not the huge, many-faceted SQL Server Management Studio application we also downloaded and installed in the Install SQL Server topic.

 

 

We expand the SQL Server Network Configuration heading and click on Protocols for SQLEXPRESS, which is the name of our SQL Server Express server.    We see that TCP/IP protocol is Disabled, a default choice for security with SQL Server installations.   To change that, we Right-click onto the TCP/IP protocol

 

 

In the context menu we choose Enable.

 

 

The dialog helpfully reminds us we need to restart the server for any changes to take effect.  We press OK.

 

 

We will now configure use of TCP/IP by SQL Server, so we double-click on the TCP/IP entry.

 

 

In the TCP/IP Properties dialog, we see that TCP/IP protocol is Enabled.   We click on the IP Addresses tab.

 

 

We scroll down to the IPAll section.   We double-click into the cell next to TCP Dynamic Ports and edit it to delete any number in that cell.   Next, we double-click into the cell next to TCP Port and we enter the number 1433.   Press Apply and then OK.

 

Tech tip:  What we have just done is a cheat, a simplification that works when we have a single named instance of SQL Server Express.  We have turned off SQL Server's use of dynamic ports and instead have forced it to always use port 1433.   If we had multiple instances, the ports used for such connection vary, so SQL Server runs a browser service (connected to through UDP port 1434) that advertises on the fly what TCP port should be used for connection.  If we know enough about SQL Server to be running multiple instances, we know how to arrange all that so connections from remote machines work.  However, if we do not have that level of expertise but, instead, are stepping through this documentation in a first encounter with the Mighty SQL Beast from Redmond, we will cheat a bit and force use of a static port for all connections.  That is less likely to go wrong for beginners.

 

 

Back in the main configuration manager the system again reminds us that any changes made will not take effect until we restart the server.  We press OK.

 

Now sounds like a great time to restart our SQL Server Express server.  

 

 

We click on SQL Server Services.   That shows us in the right-hand pane that the SQLEXPRESS instance of SQL Server is Running.

 

 

We right-click onto SQL Server (SQLEXPRESS) and choose Restart in the context menu.   The server stops and then restarts, which applies the changes we have made.

 

We have now enabled use of TCP/IP by our SQL Server Express server.    Next, we will create a database within the server that we can use for our GIS work.

Next Steps

Continue this case study on installing SQL Server with the Create a Database in SQL Server topic.

 

See the preceding topic: Open a Firewall Port for SQL Server

 

Jump to the beginning of the case study: Install SQL Server

 

See Also

Schema

 

DBMS Data Sources - Notes

 

Project Pane

 

File - Create - New Data Source

 

Command Window

 

Real and Virtual Components

 

Install MySQL

 

Install SQL Server

 

Open a Firewall Port for SQL Server

 

Create a Database in SQL Server

 

Connect to SQL Server

 

Install PostgreSQL

 

Install Oracle

 

Big List of Formats and Data Sources

 

Example: Switching between Manifold and Native Query Engines