Solved

Reporting services Sql server 2008 from stored procedures

Posted on 2015-02-05
4
97 Views
Last Modified: 2015-02-11
I want to use a stored procedure with multiple select statements  to return only one data
set  at the end For example my procedure has a (fictitious example)

Select  * into # temp1 from sales where products = 1
Select  * into #temp 2 from sales details where customers_name  = 'Juan'
Select * from  #temp1 inner join #temp2 on date_sale = last_purchase

So at the end I want my dataset return to my ssrs project to be the last select statement .
0
Comment
Question by:tonzur40
4 Comments
 
LVL 13

Accepted Solution

by:
Nakul Vachhrajani earned 500 total points
ID: 40593049
Maybe I am not understanding it correctly, but because the 1st two statements are SELECT...INTO, they won't generate any result sets. Only the 3rd will generate a result set. What's the exact issue that you are facing?
0
 
LVL 49

Expert Comment

by:Vitor Montalvão
ID: 40593377
I'm with Nakul. The first 2 statements only insert and not returning rows. The 3rd one will return the rows for your report.
0
 
LVL 26

Expert Comment

by:Zberteoc
ID: 40593609
Your example will work perfectly fine. You prepare some intermediate results in #temp1 and #temp2 temp tables and in the end you will use them to join to return the final result set you need. I don't see any problem with that, the stored procedure can be used in any context, including SSRS.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 40600245
Have a read through following article to get a better understanding of how SPs work in combination with SSRS:
Reporting On Data From Stored Procedures (part 1)
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After much searching across the internet I have found that you could not set the name of the file you were attaching to dynamic report subscriptons in Microsoft Reporting Services. I did manage to find one article showing you how your could make a s…
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question