Monday, July 28, 2014

Connect to remote SQL Server over the Internet


I installed SQL Server 2008 R2 edition on a Virtual Machine (VM). I was supposed to access this SQL Server from my laptop over the internet.

I created the .udl file on my laptop and tried to access this remote SQL Server in the VM. It was not connecting. Tried many things but still unable to connect to the remote SQL Server on the VM.

(A quick note on the UDL file. Create a simple text document and change the extension to .udl. Double-click the UDL file. This will provide tools to establish a connection to any database based on the drivers available on the laptop. We can establish the connection to a remote server. If you open the .udl file in a notepad you can see the complete connection string. This connection string can be used in any application to communicate with the database.)

After checking few internet pages here is what I found. There are two items to check and fix.

Item 1:

In the SQL Server Configuration Manager, check the “Protocols”. The “TCP/IP” protocol should be enabled and make sure the IP address uses the port 1433. This is the default SQL port.

Item 2:

Check the Windows Firewall Settings. Add an “Inbound Rule” to allow communication through the port 1433.

After fixing these two items, I was able to communicate to my remote SQL Serve from my laptop over the Internet.

Hope this tip helps you.

All Blogs so far ...