COUNT function

  • Thread starter Thread starter Teo
  • Start date Start date
T

Teo

Hi!
How can I save the value returned by a COUNT query into a variable inside a
Stored Procedure?
I tried the usual
SELECT @variable = Count(user_ID) FROM.. ...
but it doesn't work.
Any suggestions?
Teo
 
Are you trying to get the value back to your program? Did
you mark the parameter.Direction =
ParameterDirection.Output?

Tu-Thach
 
Yeah, I did, but I am trying to run the Stored Procedure itself to check if
a value is returned.
I get a value of 1 returned at the top but the variable @RETURN_VALUE is
always 0. I want it to be 1 or 0 depending on the query.
If this works in the query it will most likely work in the program.

Thanks so much in advance,
Teo
 
Back
Top