Working with OffLine SQL Server Data in Excel

Hello, I found a walkthrough by this name and found it to be very good! However, the update scenario outlined in the walkthrough is a very simple one in which a single table is updated in the Northwind database. I would like to know a couple of things:

  1. Is it possible to use similar logic demonstrated in this walkthrough to update multiple tables
  2. If it is, how complex would the coding be

Here is a brief idea of what I am trying to do:

Write a T-SQL Stored Procedure to return a result set consisting of data from a highly normalized database and display that result set in MS Excel. Then, allow updates to select columns and perhaps even inserts of entirely new data. Again, keeping in mind that the underlying data comes from multiple tables with parent/child relationships.

Thanks in advance for any and all help you are able to provide!

Tim



Answer this question

Working with OffLine SQL Server Data in Excel

  • schaneville

    Thanks Mohit! This really helps out!

    Tim


  • TexasPride1977

    Hi Tim,

    If your Stored Procedure can return the result set as a DataTable and accept any changes back, this is pretty simple to do in VSTO2005. Create a ListObject on the Excel spreadsheet and bind the DataTable to it using the SetDataBinding() method. After that, all updates from the UI will get reflected in the DataTable.

    You will need to write the code to take the updated data and apply it back to the database.

    Hope this helps.



  • Working with OffLine SQL Server Data in Excel