Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Reporting services Sql server 2008 from stored procedures

Posted on 2015-02-05
4
96 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 48

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

838 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