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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed converting from

Status
Not open for further replies.

SuperCyber

Programmer
Aug 10, 2001
35
US
I am trying to build a WHERE clause within a store procedure. Depending on the int value passed to @ID (the employee id number) it looks to see if the for varchar value of empAdmin is "YES" or "NO". The problem is that the @RETURN_VALUE is not returning anything, but the SP returns the correct value for empAdmin. Below is the SP and the Output, I'm running SQL 2000 any help would be greatly appreciated.

Alter Procedure sproc_getAdmin
@ID int
AS
declare @Admin varchar(3)

SELECT empAdmin FROM tblEmployees WHERE empID=@ID
SELECT @Admin = 'empAdmin'
RETURN @Admin


******************************************************
******************************************************

Running dbo."sproc_getAdmin" ( @ID = 6 ).

empAdmin
------------------------------------------------------
YES
(1 row(s) returned)
@RETURN_VALUE =
Finished running dbo."sproc_getAdmin".

Thanks,
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top