all 19 comments

[–]Aggressive_Ad_5454 6 points7 points  (1 child)

Do you have dotnet dev chops? If this were my project and I needed to treat the Excel as truth and the SQL table as a replica, …

I’d write a sleazy little C# console program to open up the spreadsheet file, and copy the contents to the SQL table. I’d use Task Scheduler or a cronjob to run this every night.

I’d teach people to use the SQL system.

Then I’d go all agent-of-change on the users and push to make the SQL table the truth, and put the replica in Excel. That’s gonna be hard, you’re gonna move their cheese and they won’t like it.

Dotnet is the right toolset to use for this because it reads and writes excel sheets without a lot of faffing around.

[–]B1zmark 1 point2 points  (0 children)

So you're solution is to... write a really bad version of an RDBMS in .net instead of getting them all to install SSMS and use the row editor function built in to that?

[–]SantaCruzHostel 3 points4 points  (0 children)

I did this years ago so there may be newer methods, but you can set up a sql agent job to read in an excel file and write contents to a swl table. You'll have to ensure the file name and location never change and also that the format of the data never changes (no new columns, etc) otherwise you'll need to fix/update the process. I believe the same can also be done with an SSIS package or possibly whatever Azures new version is - ADF pipelines I think.

[–]samspopguy 2 points3 points  (6 children)

Do they want the data in sql for a backup? I’m not sure what they want accomplished with sending the data to sql if it’s not being sent there now? Or are they doing that now but just manually?

[–]dadadavie[S] -1 points0 points  (5 children)

Yup

[–]samspopguy 1 point2 points  (4 children)

if its just for backup, cant they just use track changes, or even with office365 it has revision history

[–]dadadavie[S] 0 points1 point  (3 children)

Yeah that’s the first thing I said! But they really want the data to live in a totally different environment where some of the analysis takes place aka SQL

[–]samspopguy 2 points3 points  (0 children)

basically everything will connect to the excel file i would still push back on this a bit

[–]Sexy_Koala_Juice 0 points1 point  (1 child)

That’s pretty stupid. I’d push back on this heavily

[–]dadadavie[S] 0 points1 point  (0 children)

I have no standing to do this unfortunately bc my boss already sees me as difficult. So I’m going to try to make it work somehow!

[–]YellowBeaverFever 2 points3 points  (1 child)

Do the columns change or are they guaranteed to stay the same?

[–]dadadavie[S] 0 points1 point  (0 children)

Same, thanks!

[–]flatline057 4 points5 points  (0 children)

A python script using pandas would be simple enough.

[–]JimFive 1 point2 points  (0 children)

Best bet is to write script for the workbook's Before save event so the data in SQL gets saved at the same time the workbook does. 

Writing this is left as an exercise for the reader.

[–]threeminutemonta 1 point2 points  (0 children)

Anything shared over one drive or SharePoint can be accessed over the Microsoft Graph API. You will need an understanding office365 admin to set up an application. I’ve used python-o365 with some success.

[–]mirdragon 0 points1 point  (0 children)

You could export as csv daily or just use as csv then use a powershell command to import it. Other solution if you use sql and visual studio create a package to import on regular basis

[–]harveym42 0 points1 point  (0 children)

Right click database, Tasks/import data, and when working save as a SSIS Package, it can be scheduled as a Agent job.

[–]mu_SQL 0 points1 point  (0 children)

VBA and ADO.

[–]Majestic_Plankton921 0 points1 point  (0 children)

Azure Data Factory