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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-08-20 : 07:53:30
|
| Lakshmi writes "Hi,Can anyone give me a solution to, how to return multiple rows from Stored procedure to asp.net application?here is my query that would return multiple rows.... I want to create a SP for the querySELECT Item_Name, Unit_SoldFROM ItemWHERE (Unit_Sold >= (SELECT MAX(unit_sold) FROM item i WHERE i.cat_id = item.cat_id GROUP BY (i.cat_id))) AND (Cat_Id <> 103)Thanks,-Lakshmi" |
|
|
dsdeming
479 Posts |
Posted - 2003-08-20 : 08:30:32
|
| All you need to do is:CREATE PROCEDURE whateverASSELECT Item_Name, Unit_SoldFROM ItemWHERE (Unit_Sold >=(SELECT MAX(unit_sold)FROM item iWHERE i.cat_id = item.cat_idGROUP BY (i.cat_id))) AND (Cat_Id <> 103)GOYou may want to replace the 103 with @Cat_id in case that value might change. In that case, make @Cat_id an input parameter of the procedure.Dennis |
 |
|
|
|
|
|