Re: Not been able to get OUTPUT values from stored procedure in Query Analyser

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Narayana Vyas Kondreddi (answer_me_at_hotmail.com)
Date: 02/17/04


Date: Tue, 17 Feb 2004 13:39:57 -0000

Inside your stored proc, you are not setting any value for the output
parameter @n.

-- 
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Shaleen Chugh" <shaleen.chugh@the-web-works-co.uk> wrote in message
news:e0iNQqV9DHA.3880@TK2MSFTNGP11.phx.gbl...
Hi,
I have a out stored procedure as follows:
CREATE PROCEDURE findUser @username varchar(30), @password varchar(10),@n
varchar(30) out AS
declare @n1 varchar(30)
IF exists (select * from authors where au_lname=@username and zip=@password)
BEGIN
select @n1= au_lname from authors where au_lname=@username and zip=@password
END
else
BEGIN
select @n1='not found'
end
GO
When I run the stored procedure from Query Analyser I do not value of output
value.However it says command executed successfully.
declare @n varchar(30)
exec @n=  finduser 'White','94025',@n = @n output
select @n
Pls advise.
Thanks,
Shaleen


Relevant Pages

  • Re: delete a system sp
    ... > Vyas, MVP (SQL Server) ... >> how to rename or delete a stored procedure .. ...
    (microsoft.public.sqlserver.security)
  • STORED PROCEDURE - passing table name as a parameter
    ... I am trying to develop a stored procedure for an existing application that ... I get an error from SQL Server, ... DECLARE @CurrentTime DateTime ...
    (comp.databases.ms-sqlserver)
  • Re: between dates with no time consideration
    ... > Columnist, SQL Server Professional ... > declare @start as datetime ... >> only passing the date value back to the stored procedure, ...
    (microsoft.public.sqlserver.programming)
  • Re: delete a system sp
    ... Vyas, MVP (SQL Server) ... >> how to rename or delete a stored procedure .. ...
    (microsoft.public.sqlserver.security)
  • Re: help with stored procedure which returns an OUTPUT value
    ... -- Add the parameters for the stored procedure here ... varchar, @sColumnName varcharOUTPUT ... Declare @sColumnName varchar ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)