Solved

Reporting services Sql server 2008 from stored procedures

Posted on 2015-02-05
4
92 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 12

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 47

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS Columns as Rows in a Table 14 46
sql query to reportserver  table error 3 47
How to connect Power BI Desktop to ssrs report server 2 23
SSRS 2016 KPI 2 14
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…
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

786 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