security hole

From: clifford (cmi88_at_aol.com)
Date: 01/28/04


Date: Wed, 28 Jan 2004 09:16:08 -0500

here's my stored procedure:

CREATE PROCEDURE proc
@id varchar(50),@pswd varchar(20),@no_go int OUTPUT
AS
SET NOCOUNT ON
SELECT user_id FROM profile
WHERE user_id = @id AND pswd = @pswd
IF @@ROWCOUNT = 0
BEGIN
SET @no_go = 1
END
ELSE
BEGIN
SELECT date,date_mod FROM ans
WHERE user_id = @id
SET @no_go = 0
END

I've written a PERL script that gets the data from the second SELECT whether
rowcount is 0 or not. Is there a way to make the procedure die, so perl
can't get to the second statement?