Home » excel » Connecting Excel with SQL Server 2008

Connecting Excel with SQL Server 2008

Posted by: admin May 14, 2020 Leave a comment

Questions:
  • Is it possible to connect Excel 2007 or Excel 2010 directly with SQL Server 2008 so that any changes in excel would appear in database without import or export to database?

  • If it is possible What is the best possible way to do this and
    why?

How to&Answers:

To the best of my knowledge you cannot export data back to any database from Excel.
When you connect excel to a database, effectively you are just defining a datasource and excel imports the data and has no concept of row numbers, primary keys etc which it may need to update the fields. Excel is primarily a presentation tool (after being a spreadsheet).

You can connect to a database by going to:

Control Panel\All Control Panel Items\Administrative Tools\Data Sources (ODBC)

Setup up an ODBC connection to your SQL Server and then defining that connection in your Excel Datasource.

The best way to be able to view and update data that I can think of is through a query browser, either SQL Servers own “Management Studio” or a generic “Query Browser”. Just create a user with only SELECT privileges and you should be good to go. Perhaps a web-based solution like myLittleAdmin so users can visit a site, log-in and run the queries they want, update and delete as they want.

My personal favorite is Jet DataBrowser however it’s java based and hasn’t been updated since 2007.