Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two computers on my LAN. One with IIS and a public IP, the other with SQL Server and a LAN IP. How I can access to the SQL server through the IIS server from a computer connected to the internet?

share|improve this question

migrated from Mar 18 '10 at 23:35

This question came from our site for professional and enthusiast programmers.

You should never have open access to a database from the internet, it's just too much of a security risk. What do you need it for? Remote administration? – codeka Mar 18 '10 at 23:15
I'm interested why you've specified IIS as a necessity. What is the larger goal you are trying to accomplish? Maybe there is an easier way than what you've asked for help with. – Stephen Jennings Mar 19 '10 at 4:34
Really this should be on serverfault. – Mar 19 '10 at 6:38

If the goal is to do remote administration, then my first suggestion would be to setup a VPN. You would then connect via VPN to your local network and use Remote Desktop to connect to the SQL Server. If a VPN isn't in the cards, then RDP'ing directly to SQL would be the next solution although not as preferable as a VPN.

EDIT If the IIS machine has a single NIC with only a public IP, then there is no safe means of having it access a machine on a private network as they are on different networks. If however, the IIS machine is in a DMZ on the same LAN as the SQL Server, then a port in the firewall between the DMZ and the LAN must be opened. Typically, this is TCP port 1433.

share|improve this answer
i need to connect to sql server from internet to data acces. but it must be trough iis pc, not directly to sql server – Anonymous Mar 18 '10 at 23:24

If you're trying to view data, you're probably interested in Reporting Services, a feature built into SQL Server that leverages IIS. You can build custom reports that present data in a number of ways.

This video was the first easily-understood explanation I found of what Reporting Services is and what it can do.

If you really do need to query the database directly, then your best bet is to set up either a VPN or Terminal Services. You could even make SQL Server Management Studio available via RemoteApp.

share|improve this answer

How I can access to the SQL server through the IIS server from a computer connected to the internet?

I'm assuming you are trying to access the SQL Server through the IIS Service, not the IIS Service.

You can install Routing and Remote Access on the IIS Server and configure NAT. Then you can forward inbound connections on TCP 1433 (you are using MSSQL?) to the computer running SQL Server.

If you want to access SQL Server through the IIS Service... well... you are doing it wrong.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.