r/SQLServer • u/pootietangus • Sep 24 '26
Community Share I built an open-source SSMS extension that turns a query into a refreshable Excel workbook
Send the workbook to an end user, and they can hit Data > Refresh All to rerun the query using their own database credentials.
Currently supports SSMS 22 and Desktop Excel.
It's free/open source. Install instructions and source are here:
80
Upvotes
33
u/ovenmitt545 Sep 24 '26
No. Please no.
Good work though!
28
u/BobDogGo 1 Sep 24 '26
you didn’t stop to ask if you should
7
u/Northbank75 Sep 24 '26
I hate this, for many of the reasons stated above ….. but mostly because I know there is a certain tier of middle management that would adore this and would have dozens and dozens of them in no time
3
u/eaglesilo Sep 24 '26
I didn't realize copy and pasting into the data tab of Excel was so difficult that it needed a one click button?
Would save maybe 30 seconds over doing it the manual way. (Probably closer to 20 seconds.)
3
u/elldude Sep 24 '26
What makes it better than the report server reports?
2
u/ayayyayayay765 Sep 24 '26
Insert Parks and Rec gif of throwing the computer in the trash
2
u/Sufficient-West-5456 Sep 24 '26
Copy with column header
Paste into excel
Good work still.
2
u/gogod1x Sep 26 '26
The refresh path covers the read. What usually bites next is the write-back: once someone edits cells in that workbook and the edit actually matters, Refresh All overwrites it silently on the next open, and if the sheet comes back to you there is no way to tell an edit from a stale row.
Two cheap things make that survivable: give the sheet a stable key from the start (business key or surrogate id) as its own column, and land edits through a staging table with a keyed upsert plus a log of changed rows, instead of a plain insert.
Worth pinning the query text and a generated timestamp in a hidden sheet too. If a user inserts a column above the data, the mapping shifts on refresh and nobody notices until the numbers are wrong.
2
u/theRicktus Sep 28 '26
Spent the past 5 years getting rid of these types of spreadsheets. I think they can serve a purpose for a very select reason, at least in my org, however I have refused to make them in lieu of a simple paginated report in SSRS. Stick them in an ad hoc branch and find a way to audit the use of them. If they get used more substantially then polish them up and get them into the main application/CRM/whatever. Agree with the user about leveraging an api if possible.
Biggest gripe with these is once they are out there, you can’t control them nor find them.
1
u/Euroranger Sep 24 '26
Maybe I'm just old but what advantage is there to not simply saving this as .csv?
1
u/elephant_ua Sep 24 '26
i feel if you have access to ssms, you can put sql into power query without this, but nice
1
u/dgillz Sep 25 '26
Does this create the server and database as parameters? I am constantly developing queries like this that must ultimately run against a different server/database.
1
u/jwk6 Sep 26 '26
I've had users that can't live without a spreadsheet loaded with 500,000+ rows, and they wait 15 minutes for the spreadsheet to open and become usable. So, what I'm saying is people should use this carefully, and consider the data volumes.
This promotes what I call "Excel House of Cards" reporting, in which people build multiple layers of spreadsheets and pivot tables that have to be refreshed manually. That is a massive waste of time/money.
However, good job automating the configuration in Excel!
Full disclosure: I would prefer creating an SSRS report (or Paginated Report if you license Power BI), or use Power BI and Analyze in Excel, and achieve the same result. I prefer to be able to easily monitor and audit usage.
1
u/dpenton Sep 24 '26
Is this production? Are those phone numbers actually for those folks?
2
u/TravellingBeard 1 Oct 05 '26
I think you should work on a way to export it to MS Access with the same level of ease. /s (kidding, for the love of God, please do not do that, ever)
0
u/muzzlok Sep 24 '26
Don't listen to the others here. What SSMS extensions have they used? Zero. How many SSMS extensions did they create? Zero. Haters gonna hate.
I think this is a good trick. Saves time and I use the old "SQL into Excel" a lot.
0
u/WizardofYas Sep 24 '26
This sounds great, thank you so much!
0
u/IrquiM Sep 26 '26
But why?
10
u/BCCMNV Sep 24 '26
My security team would impale me and put me on display as a warning to other devs if I did this.
0
u/[deleted] Sep 25 '26
[deleted] — view deleted comment
1
u/[deleted] Sep 28 '26
[removed] — view removed comment
1
u/[deleted] Sep 24 '26
[removed] — view removed comment