-2

What's the correct way of exporting data from Excel 2013 file to SQL Server database? The data from the Excel file should be transferred into SQL when saving excel file to a database.

I know many answers for this are available but my question is bit different: every time the excel data changes, or the user clicks on save button the data in the database also needs to be updated.

2

3 Answers 3

1

The easiest way to do this is with an SSIS package. SSIS (SQL Server Integration Services) is a package built in to SQL which allows transformations between data formats.

You can create a package by right-clicking on your target database in SQL Server Management Studio and selecting Tasks > Import Data. In the wizard that comes up asking for a data source choose "Microsoft Excel" from the top drop-down labelled as Data Source, then follow the wizard through. You'll have the choice of importing the Excel data into a new table or mapping it into an existing table.

If you want do this programmatically, you can save your package at the end of the wizard and then invoke it via code. But that's a different question.

Sign up to request clarification or add additional context in comments.

1 Comment

THANK U for reply . i have tried that but i selected the select the Microsoft Excel and try to go to next step . It gives me following error . "Microsoft.ACE.OLEDB.12.0" provider is not registered on Local machine(system.Data) " . i have checked for solutions on net but seems not relevant. i have office 2013 and windows 8 on my machine.
1

What you want is not possible (as long as I know off). You can use SSIS package to migrate the Excel sheet into SQL Server, but is imposible to determine if someone "click save" or do some changes on the excel file. SSIS package can be programed to run on schedule or by demand. You should investigate SSIS packages. It is not easy to learn, but do what you need.

Comments

0

Maybe you would like to try a tool I have developed? It's an Excel Add-In that exports Excel data to SQL Server.

There is a feature to automatically export the data to SQL Server every time you press the save button in Excel. If you need to update the database every time a cell value change, you will need to add a few lines of VBA-code that will push the data to SQL Server.

To beta testers I currently give away a free license, so if you are interested in testing it out, send me an email:)

www.sqlpreads.com

1 Comment

Yes , wud like to test it .Please send en email on [email protected]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.