This is for anyone having trouble connecting to SQL Server on Parallels from ColdFusion on Mac OS X.
Each time I’ve installed a new version of SQL server — be it 2005 or 2008 — it took me a bit a random clicking to get a ColdFusion datasource connected to SQL Server.
Here are some tips.
- Make sure the service is running. Well duh… but this has tripped me up before, so just check and save yourself the headache.
- Make sure that TCP/IP is enabled. To do this, open Start => All Programs => Microsoft SQL Server 2008 => Configuration Tools => SQL Server Configuration Manager. In the left column, expand SQL Server Network Configuration. Select your SQL Server instance (note the instance name e.g. SQLEXPRESS) and then double-click TCP/IP in the right column to open the TCP/IP Properties. Under the Protocol tab, make sure Enabled is Yes.
- While you’ve go the TCP/IP Properties window open, click the IP Addresses tab. From this tab, you can see what IP address SQL server is running on. Equally important, you will see the Port Number. The default port number is 1433, but I’ve got three versions of SQL Server running and each one uses a different port number.
- Login to your ColdFusion administrator and create a new SQL Server Datasource. The Server will be the IP Address (e.g. 10.0.1.6) followed by a colon (:), followed by the instance name (e.g. SQLEXPRESS). You get the port number from the IP Properties window in step 3 above (e.g. 1094).
That’s it. If you’ve got Windows Firewall running, make sure you can accept traffic over the port being used by SQL Server.