Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
joelhulen
Starting Member
5 Posts |
Posted - 2001-04-04 : 11:15:29
|
Hello, all. I am trying to create a stored procedure that will store several values within an output parameter.Here is the background information:I have several groups of people I am storing accounting data for. I am trying to create an asp page that will display a ytd summary on these 12 groups of people, all in one page. The formatting is as follows: Group 1. a. $xxx,xxx,xxx b. $ xxx,xxx c.... Group 2. a. $ xxx,xxx b.... etc.The summary rounds the sums of the money values for each subgroup within the groups. My goal is to use one stored procedure call in my asp page (to maximize performance), so I am exploring the option of using output parameters within a single stored procedure.I have run accross 2 problems:1.) I cannot use the "SELECT @GROUP1 = Group,SUM(XXXXX),Sum(XXXX),SUM(xxxx) WHERE Group = '1'" method because I am using aggregate functions within my select statements (Average and SUM), therefore, I receive this error: "Error 141: A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations."2.) Really a question...if I am able to use output parameters in my stored procedure, will it be able to store all the results, like @GROUP1 will return:a. "$xxx,xxx,xxx"b. "$ xxx,xxx"etc.?I know this question may be a little in depth, but I am really hitting a wall with this one. Any help will be much appreciated!Thanks in advance,Joel  |
|
|
|
|
|
|
|