Generate automatic SQL reports and output them to Google sheets - sql

Currently, I'm running several reports using SQL copying the data to Google sheets, amending said data to generate daily stats.
Most of the reports I run using SQL have the same date range.
If it helps I can post a couple of the SQL reports.
I'm hoping there's a way to automate this?

You can use Google Apps Script to pull data from SQL to Google Sheets and you can automate it by adding a time-driven trigger to run depending on how frequent you want it to.
References
Installable Trigger(Apps Script)
How to Retrieve SQL Data Automatically Using Google Sheets Script

Related

Direction to create a frontend/GUI for simple SQL query?

I work on a team that creates adhoc SQL queries for a large database for users that are performing research. These searches are done with Excel via ODC files with ODBC connection.
I'm looking for a program / best language suggestion to create an app for users to run the simpler queries themselves that they request. Basically a window that has a few text boxes for the variables as well as some date range boxes. Runs query and exports to a spreadsheet etc.
So far I've only found tools that run the raw SQL query code itself.
Thanks in advance. -Steve

Querying Tableau Server dashboard from Excel

I'm trying to setup a query to a tableau server from MS Excel 2016 for the purpose of getting the data automatically out of tableau massaging it and emailing it out - I can do all of this relatively simple, HOWEVER, I have no clue how to setup the query to the tableau dashboard from Excel 2016.
Any advice would be highly appreciated I'm not certain even where to start and online searching has only netted me querying excel files from tableau, not the other way around

Automate export from MS Excel to MS SQL Server

Is there a way to export data from a MS Excel file into a SQL Server table automatically? Maybe this is done using a script of some kind.
If it's not possible to be completely automated, perhaps there's a way to do it using minimal user effort. (For example clicking a button or link)
There is a MS Excel spreadsheet where the data keeps having to be manually exported to SQL Server.
I've done this using Excel to Access before, but not too certain on how to do it using SQL Server (MS).
*MS Office 2013 and MS SQL Server 2012.
The other answers are ok. I just want to suggest an additional alternative.
If it is just 1 specific Excel file that is frequently updated, I would consider using VBA. For example, write some VBA code in Excel that uploads changes to the database when the spreadsheet is saved (or the user presses a button).
The problem with using a scheduled job is that Excel is basically a single user application. If someone has the spreadsheet open or is doing something in it when the scheduled job runs or moves the spreadsheet to a different folder, then the job may fail.
This way you also get the updated data in your database in something close to real time instead of waiting on a job to run. This might take more time and effort to set up though than some of the other answers.
You can use SQL Server Agent to run a scheduled job that imports data from an Excel worksheet into a SQL Server table.
The import is relatively straightforward to do using Integration Services, but if you've not used either of these before you might need to do some reading up on it.
You can do the following:
You need to create an SSIS package and then create a job to run the package.
The easiest way to create the SSIS package is with "Import and Export Data" tool of SQL Server. It has a nice step by step wizard.
You set everything it asks you from the source and the destinations. Until you get here, select the "Save SSIS Package":
Then you only have to create the job to run it :)

Automating an upload of data to rdbms from a google spreadsheet

I have a google doc that I'm using to update a table in a sql table and at the moment I do it manually; copy and paste the data from the google doc. into excel, remove the columns that I don't need then save as a CSV and upload.
I'm wondering if there is a way that I can automate this? The report it's for is daily and the upload is becoming a bit of a bore!
You can also go the python-route by utilising the following python libraries: gspread, oauth2client, pandas and sqlalchemy (source). If you want to automate it, use cron or crontab to run your python-script on a hourly, daily, weekly or monthly basis.
What DBMS do you use?
If you use Microsoft SQL Server, you can use SSIS (SQL Server Integration Services), the easiest way to do this for a novice would be to right-click on the database in SQL Server Management Studio --> Tasks --> Import Data, then follow the wizard to set up the data source (flat file / Excel file etc.) and the data destination (DB table). Once you've finished with the wizard, you can save the package and re-use it later on (or even automate it via SQL Agent job). You can edit the package in Visual Studio (aka SQL Server Data Tools) prior to deployment/automation if needed.
More on SSIS: https://msdn.microsoft.com/en-us/library/ms169917.aspx

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.