You are here: Re: Identifying results sets when stored procedure called multiple times « MsSQL Server « IT news, forums, messages
Re: Identifying results sets when stored procedure called multiple times

Posted by Erland Sommarskog on 10/19/05 00:49

(wxbuff@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, esquel@sommarskog.se

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация