Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output parameter SP

Status
Not open for further replies.

MikeMcKeown

Programmer
Apr 1, 2003
69
GB
Hi all,

I have created the following stored procedure however I keep getting an error saying that there is an error near the SET. Am i right in assuming that I could use the output of the query in an adp project with VB. I could say if output greater than 2 then ......


CREATE PROCEDURE SP_Count_Territories
(@RCValue as numeric, @RecCount AS int output)
SET @RecCount = (SELECT COUNT(No) AS [Count]
FROM dbo.Details
GROUP BY _No
HAVING (Details.No = @RCValue))
RETURN

Thanks in advance
 
try
Code:
CREATE PROCEDURE SP_Count_Territories 
(@RCValue as numeric, @RecCount AS int output)
AS
SET @RecCount = (SELECT COUNT(No) AS [Count]
FROM  dbo.Details
GROUP BY _No
HAVING (Details.No = @RCValue))
RETURN

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top