How to open an Excel Spreadsheet from SSMS dependant on arguments - sql-server-2008

I want to have a system whereby someone who doesn't know any SQL can retrieve a excel spreadsheet based on arguments, such as data based on a list of employees, or up to a certain date, etc.
How would you approach this problem? I am using MS SSMS.

Related

Is it possible to loop through datasets in SSRS report and save each dataset as an excel spreadsheet?

I am new to SSRS and I just want to know if it is possible to loop through datasets in an SSRS report and save each dataset separately as an Excel spreadsheet.
For example, if we have a report with 5 managers, if you click on each one of these managers you can see/drill down to all the supervisors that are under this manager and if you click on any of those supervisors you can see all the employees that are under that particular supervisor. Now, what I'm trying to do is I want to save each one of the managers' (and supervisors' eventually) downline in an excel document (although it really can be in any format as long as they can later drill down on it) so that each manager can only get his/her own supervisors/employees. Can this be done in SSRS and if so I'll try to figure out how. Also, if you think there is a better way to restrict every manager from seeing every other manager's supervisors employees please let me know. The report that I currently have is perfect but everyone can see other people's supervisors/employees and their data.
Thanks!!
if you want to generate flat files to send out, then you have to create a parameter on your report, deploy it to the report server, and then create 5 subscriptions to that report.
in each subscription you can set the parameter and where you want to write/email the file.
If the subscriptions part doesn't work well for you (if you have too many to manage), you can use data driven subscriptions (enterprise edition feature), rs.exe scripts (if you figure out how it works), or use my new cool tool (http://busysreports.codeplex.com)
also, you don't have to generate flat files, you can also set up some security so when the managers open the report in reporting services they see only their data.

How to automate a SQL script in Excel

Currently we have a process that our IT department has to do manually on a weekly basis that we really need to automate. We have a few of our employees that get paid a different way. The hr department has to send us the employee names and dates and we have to connect to a MySQL database. Put the correct employee numbers and dates in a script we have set up. Execute the script. And then send the hr department an email back with the table it generates.
I was thinking is there a way to automate a SQL script in Excel using macros or something similar. That way we could send the hr department the spread sheet. They go in the spreadsheet input the employees and dates in cells. run the script and let it give them their data back?
Any input on this would be greatly appreciated. Thanks!
There are many different things you could pursue, depending on you what need done exactly. If I was in your shoes I would discuss with your IT dept about SSIS packages, http://en.wikipedia.org/wiki/SQL_Server_Integration_Services . With SSIS you can upload excel docs, have it run the queries you need and then export the spread sheet with the updates.
However, you will need someone knowledgeable of SQL servers and SSIS to set this up.
You could integrate the SQL query to a VBA script within your Excel file, but you would definitely have to code that.
Take a look a this example to get automated query from SQL Server:
Using Excel VBA to run SQL query

Exporting SSRS Report to the same excel workbook every month

I am new to SSRS and I'm trying to automate a report for our client. I have comnpleted the design but I have not deployed it to the reporting server. When I manually export the report to excel via the design viewer in Business Intelligence Studio 2008, I get a new workbook every time. However, I want this report to export to excel automatically, to the same workbook, on the same worksheet, every time it is run per month. This way, i can create an excel workbook that contains the report data and other worksheets with templates that auto populate, based on the report data.
I'd like to avoid exporting it to a new workbook, then copying and pasting into the workbook with all my templates manually. I'd also like to avoid exporting to CSV or XML and then importing it into Excel.
Is this possible? Perhaps this is via the deployment of the report and I just haven't gotten that far?
Thanks!
Hi welcome to stack overflow.
Can l suggest looking at another related technology SSIS (Sql Server Integrated Services). This will allow you to extract the data from a data source. Then using the the out of the box components export the data to Excel. Once you have created the package in SSIS, the package can then be scheduled to run (if you have SQL server instance) to run at specific times. I have used that solution in my current role to produce reports automatically and then email then to various people.
The link below shows one method of exporting to excel using BIDS, and suggests some other ways.
http://cavemansblog.wordpress.com/2009/04/17/ssis-export-data-from-sql-server-2005-to-excel/
Also this link http://dougbert.com/blog/post/Excel-in-Integration-Services-Part-1-of-3-Connections-and-Components.aspx is one of three that covers the topic of connecting SSIS to Excel, has some excellent advice IMHO
SSRS has a scheduler build in, which can run reports at specified times, this l think is only available in the enterprise edition. This facility will if memory serves right, will not insert the data, only create or overwrite the file each time. So l am not sure if this is the solution you are looking for.

Fill a form in excel with data from sql, SSIS or SSRS?

We have been provided a form, layed out in Excel, that needs to be filled in based on data we have sitting in our SQL database.
I'm trying to determine the best way to electronically fill the form in. I could create an SSRS report, and lay it out as close as possible to the form provided, but I was wondering if I could use the excel file as a template in SSIS and have SSIS fill in the various fields.
It is not a simple table spreadsheet.
Use an SSIS package, connect to your DB and do the transformations on the package itself, there are several components, I'm pretty sure you will be able to deal with all the situations.
You could use the report and save it as excel but I think will be more complicated.
One thing to consider is that SSRS has limitations when exporting to excel. There is a limit of 60k rows. If you try to export more you will get:
Excel Rendering Extension: Number of rows exceeds the maximum possible rows per sheet in this format; Rows Requested: 209048, Max Rows: 65536
There is a work around to this but its time consuming.
This is an excel 2003 limitation and SSRS 2008 cannot export to excel 2007

Can I fire-up an Access 2007 app from within Excel and automatically import excel values into Access?

I have a pawnshop app where when a customer arrives at the shop, the clerk uses an Excel worksheet to calculate how much money he can lend to the customer, based on the current market price of gold, gold karats and weight. If the customer agrees with the calculated amount, the clerk then goes into my Access 2007 pawnshop app and has to re-enter the price of gold and the total weight for each type gold karats. I would like to know if there's a way for my Access app to automatically plug-in the values which were entered in the Excel worksheet.
From VBA within Excel, you could create an ADODB.Connection with a connection string pointing to the Access Database. Directly with the Connection object (but preferrably with an ADODB.Command object) you could run SQL inserts into the Access database that pulls its data from a Range on the worksheet.
This is assuming you have some sort of VBA knowledge which I am uncertain if you do as this question was not tagged with VBA.
Edit: You also need to make sure you include the Microsoft Data Access Objects Reference to the VBA project. (Use the latest version available to you)
There might be a way, but I would implement the logic inside of a little database app with a calculate and apply button.