Yes I tried that, but all I got back was the last select statement.

I even tried

create Procedure ProcedureName
@parm1  int,
@parm2  int output

Processing here

Select @parm2 = Count(*) from table
Select * from table
GO

and in the ASP page

Set RS = Conn.Execute("Execute ProdcureName @Parm1=1")
Response.write RS("Parm2")
I get the error "Can not find ordinal referenced in the line above"


-----Original Message-----
From: Chris Tifer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 1:35 PM
To: ActiveServerPages
Subject: Re: Quick SQL Query Question


If I was using a stored procedure, I would probably just
set up an output parameter with the count.

SET NOCOUNT ON
     SELECT @myOutputVar = COUNT(*) FROM TABLE
     SELECT * FROM TABLE
SET NOCOUNT OFF

Unless there's a specific need for EACH row to also return
the total in the table, but for the life of me I can't come up with
a reason.

Chris Tifer

----- Original Message -----
From: "Steve Abaffy" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Wednesday, October 09, 2002 7:42 AM
Subject: OT: Quick SQL Query Question


> Hello,
>
> How do I write a query that will return all the rows in a table with the
> addition of the count of those rows?
> Something like
>
> Select Count(*),* From table
>
> Thanks in Advandce
>
>
>
> ---
> You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
>


---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%




---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to