How do I to build and then populate a multi-tab excel spreadsheet using an SSIS package? - sql

I currently have a package that creates an excel spreadsheet with multiple tabs, and it names each column in each tab. Later in the package, I have excel connections that select my data using queries and populates each column in each tab based on the mappings I define. This has worked for a long time, but since a driver update, my OLE DB connections wont let me create the excel spreadsheet anymore. The key here is that the package needs to be able to be called by a scheduling system and be totally hands off and self sufficient. Also, the excel spreadsheet is created brand new with every execution of the package so we can keep an archive of old reports.
I've tried to use the existing excel connections to also build the spreadsheet, but I don't see a way to populate multiple tabs in the same spreadsheet with excel connections.
Is there a better way to do this without having to do a C# script.

Related

Excel - automatically append data from sql

how can i make to automatically every day run my excel file, reload data from db and append in existing data.
Do I need to use vba script or...???
I have an idea that might work,
Write a script in any backend language of your choice (Java, Python...) that creates an active connection to the database
Run it to periodically query a database table(MySQl,..) and store newly entered data into variables
Continuously append that data into the excel file as you normally would any file.
Most languages have packages to handle excel files, I think it should do it.
Good luck

Create SQL Table that will import automatic from Excel whenever that Excel is updated

So I have an excel spreadsheet with Product and Notes. I'd like to import this information into SQL and everytime people enter more products and notes into this excel sheet, it will automatically updated to the new one whenever I run the syntax?
I finished creating Product - Notes, which I imported current data into that table.I was planning to use insert into function, and every day insert the new values in the table. But this seems too manual.
Is there a way i can do this? The excel spreadsheet is updated daily.
I'm using SQL Server 2008
I'm sure this is possible. You could have the excel connect to your database and then write some macros to save the data to the table when there are changes or new rows are written.
It would not be easy. There is a lot of complicated logic here and excel was not written to be a front end for a database.
I believe the time spent changing your spreadsheet to work this way would be better spent actually writing a client server application to modify the database using a web application or a local application. Client server front end applications are easy to write these days with lots of examples, tools and templates. For someone with experience a simple data entry / modification form is just a couple of days work for a robust application.
Changing the excel file would be much harder.
You could use SSIS to import the excel data into your database on a scheduled basis.

How to extract data from a database and populate a sheet in Excel

I am storing data in a backend database (PostgreSQL) which is running on a Linux machine. I want to be able to fetch data from the database, and populate a sheet in an excel workbook, so that I can carry out analysis in Excel.
It has been quite a while since I wrote anything in VBA, so I would appreciate some help (or links) in getting started. I would like to know the best way to approach this:
Pure VBA solution OR
Mixture of C# or other .Net language for data extraction logic and VBA for manipulating Excel objects (sheet data population etc)
Any ideas, tips, snippets and/or links that can help me get started on the twin objectives:
fetching data from a backend database (PostgreSQL) into Excel
populating a specified sheet in Excel with the columnar data retreived from the database
will be much appreciated.
If you are just trying to import data, Excel can do that without additional code. Just set up your windows client to connect to your postgreSQL server thru ODBC. (Here's one way guide to setting that part up: enter link description here
Then in Excel (Use a modern version, like 2007 or greater) from the "Data" tab, click on "Existing Connections" to connect to the ODBC connection you set up and pick the tables/data to import into excel. Once the spreadsheet has loaded the data, you can just click the "Refresh All" button to update the data.

Updating a database from an Excel spreadsheet in .NET

Can Teradata tables be updated in an VB.NET application by reading an Excel spreadsheet and pulling certain values from certain columns? If so how?
Yes.
This link shows how to read from a server database and update Excel, via ADO.NET and two OleDb connections.
It should be easy to modify that code to do the reverse. ; you'd just need to swap the connection strings shown in that code, so that the source is Excel, and the destination is your Teradata db.
There are some Excel-specific things in the queries, but you get the idea.
NB: This is not Excel Automation. It uses ADO.NET to read/update an Excel sheet. You don't need Excel to be installed on the machine in order to do these queries.

Exporting Excel cell data to database via Excel macro?

Can I create a macro written in C# for Excel that allows me to export a cell's data to a SQL Server or Access database?
Basically, I'd like to create a button in Excel that saves the data in certain cells to a database. Can this be done?
Instead of creating a UI from scratch for a program, I've decided using Excel as the user environment would be better for business needs.
How to automate Excel by using Visual C# to fill or to obtain data in a range by using arrays would be a good starting point.
Be aware, you're going to find it frustrating to control what people attempt to enter into the Excel sheet, as the inherit flexibility of the data works again your efforts to write it to a database destination.