Hi I am using vs2008 making an asp.net.vb app. The following stored procedure resolutely insists on returning an integer. I on the other hand was hoping for, and expecting, a single name to be returned. Can anyone help amend the sp or describe what I need to do to get the result I desire.
ALTER PROCEDURE [dbo].[getusername]
(
@email varchar ,
@retvalue nvarchar (10)output
)
AS
SET NOCOUNT ON
SELECT myemailaddress
FROM newtable
WHERE (myemailaddress = @email)
Thanks for all and any help.
The return code for a stored procedure is always an integer. You can set it by using the
Returnstatement in your procedure like so:Return 9There is no way to return anything other than an integer using the procedure’s return code. If you want to use your output parameter, you need to set it:
ADDITION
Here is a small test script:
Perhaps you have a syntax error in your script?