Recently I had to connect my PHP application to a MSSQL server. This is a step by step guide to viewing, updating and editing MSSQL Server databases on your Mac!

Step 1:
Download SQL Development. Oracle has an excellent FREE SQL development tool, SQL Developer that will allow you to connect to a MSSQL database server.

sqldev-40-banner-1972301

 

Step 2:
Update JDK if needed. As of writing this, the SQL Developer requires Java JDK 7. You can download a version for Mac or any other OS Here:

http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

Step 3:
Download MSSQL JDBC driver. You’ll need to add an open source MSSQL JDBC driver to your computer. the jTDS driver allows you to connect to Sybase and MSSQL. Download a copy here.

http://sourceforge.net/projects/jtds/files/ (thanks to ickzon for developing and maintaining this project!)

Extract the jtds-x.x.x.jar and put it in your favorite java extensions directory. I put mine in /Library/Java/Extensions.

java-extensions

 

Now you’re setup and ready to connect to MSSQL on your Mac OS X computer.

Step 4:
Run Oracle SQL Developer Application. I’m running v4.x. Under the main menu you’ll find the Preferences option.

sql-developer-preferences

Inside of Preferences click the “Database” and then “Third Party JDBC Drivers”

sql-developer-3rd-party-jdbc-drivers

Click the “Add Entry” at the bottom of this screen. Then navigate to where you placed the jtds.jar on your hard drive in Step 3. I put mine in /Library/Java/Extensions/

sql-developer-mssql

 

After you’ve completed these steps, you can now make a new connection to a MSSQL or Sybase database server! Navigate to “File -> New”

osx-mssql-client

You’ll now see a SQLServer and Sybase Tab