Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Consuming the rows of a called SP inside another SP
Message
De
20/11/2006 14:31:52
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01171249
Message ID:
01171255
Vues:
7
>
>-- SP_1
>select .... -- a really complex query
>return @@rowcount
>
>
>-- SP_1Count
>declare @iRows int
>execute @iRows = SP_1
>select @iRows as NumberOfItems
>
>
>When SP1_Count is called from anywhere (QueryAnalyzer, VFP, ADO) there are two recordsets returned. I'd really like to only have the select @iRows result come back to the client. So how can I get SP_1Count to swallow up the recordset produced by SP_1?


Or if sometimes you need the recordset from first query:
S P 2:
SET NOCOUNT ON
DECLARE @i int
DECLARE @Test TABLE (field list as SP1 recordset)
INSERT INTO @Test  EXEC SP1
SET @i = @@ROWCOUNT
.....
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform