1. Download the JDBC driver from Microsoft from:
2. Execute it, and it will be decompressed to the selected location
3. Create folder c:/SQLJDBC and place sqljdbc_2.0 inside it.
4. Start the Notepad application as administrator and open the file:
C:\Program Files\MATLAB\R2010a\toolbox\local\classpath.txt
5. Add a reference like this to the JDBC driver after the last line of that file:
c:/SQLJDBC/sqljdbc_2.0/enu/sqljdbc4.jar
6. After that you have to restart MATLAB and then you can test the connection:
dbConn = database('master', 'user', 'password', 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 'jdbc:sqlserver://localhost:1433;databaseName=master;');
7. To test the connection you can execute:
ping(dbConn);
8. Please note that the local instance of SQL Server requires you to have the TCP/IP protocol network connections enabled.
----------------
Other references: http://www.mathworks.com/help/toolbox/database/ug/database.html
----------------
Other references: http://www.mathworks.com/help/toolbox/database/ug/database.html