Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 stored proc is not returning proper values .....?

Author  Topic 

senthilramtrs
Starting Member

29 Posts

Posted - 2008-05-13 : 05:57:41
this stored procedure is returning -1 always ....

but i want 1 or 0....

CREATE procedure checkNumberAvailable

@CNumber varchar(20)

as

if exists (SELECT * from Entry where BillNumber=@CNumber )
return 1
else
return 0
GO


Regards,
Senthil Ram TRS

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-05-13 : 06:12:31
How are you executing the procedure and getting return value?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-13 : 06:12:39
[code]CREATE procedure checkNumberAvailable
(
@CNumber varchar(20)
)
as

set nocount on

if exists (SELECT * from Entry where BillNumber = @CNumber)
return 1

return 0[/code]


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -