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)
 Write stored procedure to validate registrationNum

Author  Topic 

Soultech
Starting Member

1 Post

Posted - 2007-01-05 : 06:27:03
Hi every one,

Iam new to SQL, I have to write a stored procedure to validate registration number so that if the given registration nuber is in the tabel then stored procedure should return true otherwise fals.
can any one please guide me to write this stored procedure.

thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-05 : 06:47:09
Something like this:

Create Proc p1
(
@regno int
)
as
begin
If Exists (Select * from tbl where registrationno = @regno)
Return 1
Else
Return 0
end


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

- Advertisement -