Problem with returning multiple output parameters | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Problem with returning multiple output parameters

Hi all,
Here i am using small stored procedure which is calling from vb with two output parameters. It is giving below error.
Error:
Syntax error converting the varchar value ‘j4ty4d3h’ to a column of data type int. In my procedure i didn’t use int datatype. Here is my Procedure:
create procedure jobsites1proc
(
@site varchar(20),
@username varchar(200),
@pwd varchar(100) output,
@loggedin varchar(1) output
)
as
set nocount off
begin select @pwd=pwd,@loggedin=loggedin from jobsites where [email protected] and [email protected]
begin
if @@RowCount >0
begin
return @pwd
return @loggedin
end
else
begin
select @pwd=’0′
select @loggedin=’0′
end
end
end What is the problem? It is very urgent for me. Plz help me out. Thanks in advance. Lalitha.C
Lalitha,
How did you declare the Parameter type in VB? If you specified as adInteger then you will get this error
Madhivanan Failing to plan is Planning to fail
You should allways return 0 or some other constant your app expects. Pwd is varchar(100) and loggedIn is varchar(1) and return value of sp is allways int, hence the error.
]]>