Combining existing Excel Template with existing SQLscript

Viewed 60

I use an excel 2010 template, and an existing SQL 2012 script. Instead of pulling the data and then pasting it into the excel template, I'd like to imbed the sql script in the template. My thought is to have a spot to enter the ID number, and the template updates with just that information. Any suggestions? I enherited the process, but not the knowledge to make this update.

1 Answers

You can import data from SQL Server into Excel without Macro or SSIS‌ package.

1) Save your query as a VIEW‌ in SQL Server. I Called mine V1.
2) Go to Excel and click on your desired sheet and choose "DATA" ribbon and choose "From SQL‌ Server".
enter image description here




3) Fill the your SQL server specs.
enter image description here




4) choose the Database and View.
enter image description here




5) For the next visards just press "Next" and "Finish".
6) If you wanna see changes in your query results just press "Refresh all" enter image description here




I hope it helps you with your problem. If you want to filter on your data before it loads into Excel this link is useful:Calling a Stored Procedure from Excel with multiple parameters

Related