Monday, May 5, 2014

Access to SQL Server by SQL Query Analyzer or Management Studio.

Hi Everyone,

As Acumatica runs on SQL server, we may need, time to time to access our Database by Management Studio. And there could be connectivity issue if we try it, just out of the box...

Most of the times, since we are on the cloud, the SQL server is somewhere outside, not in our office. To access it, we need to follow three simple steps:

1. Open up firewall on SQL server side for the port used by SQL Server for listening.
2. Make sure we specified correct port on the SQL server properties.
3. Make sure on the CLIENT side we choose the same port to access the server.

First.

Open the firewall for SQL port 1433 for Inbound Connections. This need to be done AT THE SERVER SIDE. So please Remote to the server then open this up:



Click at the Inbound Rules, Add new rule, specify that it is for the PORT type of the rule. Then add TCP port 1433 to it.
Well next you choose network profile from where you allow to open it up. Most of the time Domain is enough.

You may need to restart Firewall Service on the server for the rule to take force.



Second. 

Let's open the port for listening at the SQL server side. Here is the hint, if we use NAMED INSTANCE for the SQL server, port on SQL side will be assigned DYNAMICALLY, which is obviously NOT what we want. We have to fix it to be STATIC. Most of the times, historically, we used 1433 port. So let it be 1433 for my example. It is done Here:


Next would be to press right click on TCP/IP protocol, choose properties, then you will see list of IPs.
Scroll down to IPAll or choose the one that your server is configured and:
A. Erase the entry at the Dynamic Port
B. Place 1433 at the TCP Port field
Result:
Click Apply. Then Restart the SQL server.

Third.

Funny thing but this seems to be the most important step. On the client side, when you call SQL Management Studio, please use the following syntax. You NEED to indicate the port at the server IP address :) :


Please take note on that comma port number :)
The thing is, even if you indicated the dynamic off on the SQL, client still thinks its own ways when talking to the SQL server.

All the best,

Sergey.

No comments:

Post a Comment