472,956 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,956 software developers and data experts.

Identifying results sets when stored procedure called multiple times

I have a report based on our product names that consists of two parts.
Both insert data into a temporary table.

1. A single grouped set of results based on all products
2. Multiple tables based on individual product names.

I am getting data by calling the same stored procedure multiple
times... for the single set of data I use "product like '%'"

To get the data for individual products, I am using a cursor to parse
the product list.

It's working great except that I have no idea how to identify the
results short of including a column with the product name. While that
is fine, I'm wondering if there is something that is like a header or
title that I could insert prior to generating the data that would look
a little tighter.

Thanks in advance-
Danielle
wx****@aol.com

Oct 18 '05 #1
3 2509
(wx****@aol.com) writes:
I have a report based on our product names that consists of two parts.
Both insert data into a temporary table.

1. A single grouped set of results based on all products
2. Multiple tables based on individual product names.

I am getting data by calling the same stored procedure multiple
times... for the single set of data I use "product like '%'"

To get the data for individual products, I am using a cursor to parse
the product list.

It's working great except that I have no idea how to identify the
results short of including a column with the product name. While that
is fine, I'm wondering if there is something that is like a header or
title that I could insert prior to generating the data that would look
a little tighter.


I'm not really sure what you mean. You could insert a result set before
the main result set which has the header data. But then you need to
cope with multiple result sets, and not all tools handles this easily.

But it sounds to me, as there are potential for performance improvements
in the report. Ideally, you should get all data in one call to avoid
roundtrips. And cursors is something to avoid if possible. Then again,
you say "parse" which worries me. Data stored in a database should not
have to be parsed, if it is stored properly.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Oct 18 '05 #2
Erland -

Thanks for the reply.

I work for a software company whose support organiztion is broken into
groups. Each group supports certain products and within each group
there are multiple support levels (the typical level 1, level 2
etc...). The management would like a report to follow some parameters
such as the number of new support incidents in a given period, the
number closed etc...

At the first level, the report returns results based on the level of
the support worker regardless of the products.

The next level of breakdown is by product. That is where I used my
phrase 'parsing' - I have a cursor that reads the products for which
incidents were opened during the specified period and a table is
created summarizing the work done for each product.

As I sit here, I realize that there are efficiencies to be gained
(maybe? - I am still a novice) by using 'group by' etc... but I was
specfically asked to create a report that showed discrete tables for
each product. Hence the cursor.

I appreciate what you are saying about performance but the concern
there is not as high as it might be elsewhere as this report will run
on a weekend against a server which is not supporting other heavily
utilized applications.

Hope this helps clarify.

Danielle

Oct 19 '05 #3
(wx****@aol.com) writes:
The next level of breakdown is by product. That is where I used my
phrase 'parsing' - I have a cursor that reads the products for which
incidents were opened during the specified period and a table is
created summarizing the work done for each product.

As I sit here, I realize that there are efficiencies to be gained
(maybe? - I am still a novice) by using 'group by' etc... but I was
specfically asked to create a report that showed discrete tables for
each product. Hence the cursor.


So that's tables in the report, not database tables?

Well, a good reporting tool should be able to produce several tables
from one result set.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Oct 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: p_le_sueur_1 | last post by:
Dear All, This is a query surrounding a problem I encountered yesterday. In SQL Server, it is possible to write a procedure that has one or more select statements in it. The results from...
0
by: jamiemcc | last post by:
Hi, I would like to have 1 stored procedure call another stored procedure (which contains multiple select statements) and then be able to access the 3 result sets. Example Create Procedure ....
2
by: Jegg | last post by:
I wrote a web app using an ASP front end (not .NET) connecting to a SQL Server 2000 (no SP) back end. Both the web server and the database server are Windows 2003 boxes. The app was running fine...
5
by: Stanley Sinclair | last post by:
I have a need to return multiple result sets from a stored procedure. Want that SP to call others to get the data. Win2003, db2 8.1.5. Can't figure out how to handle open cursors, and return...
2
by: Patrick Olurotimi Ige | last post by:
When i run the code below with stored proc :- I get only the first table results :-"templates" even if i fill the dataset with another table for example category,pages etc.. Any ideas? ...
2
by: alex.mcshane | last post by:
Hi - I would be grateful for any knowledge regarding the following. Whilst QAing Stored Procedures developed by colleagues, I noticed the following 'superflous' parameter specifications:- 1)...
3
by: simon | last post by:
hello, i have a form where there are multiple dropdown lists that will all be populated from the same initial data query. i have a vb class defined to make the stored proc call and that returns a...
0
by: r1 | last post by:
I am relatively inexperienced in using delegates and asynchronous methods. I read several articles, and then I developed my own code with a mission to improve the performance. Wow! I cannot...
6
by: BostonNole | last post by:
I am using SQL 2000 and VB.NET (VS 2005). I have three stored procedure: sp_A, sp_B and sp_C I need to be able to call sp_A once and sp_B and sp_C 1 to n number of times all within a single...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.