You don't have to perform another query. The last query that is performed
on a Stored Proc is the one that gets returned at the end.
In your example the query you performed gets returned at the end even if
its not the last statement. Try it and see.
SELECT FirstName, LastName
FROM Members
WHERE FirstName LIKE @FirstName AND LastName = @LastName
GROUP BY FirstName, LastName
HAVING COUNT > 0
sebastian palmigiani <[EMAIL PROTECTED]> on 09/13/2000 06:12:28 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (bcc: Jerry Tolentino/SIAC)
Subject: Stored Procedure Help Again
The only way I can make this work is to have 2 queries. It seems that I
should be able to use just one query. But if I have just 1 query and say
IF @@rowcount > 1 RETURN 2
It does not work
--------------------------------------------
SET @FirstName = @FirstName + '%'
SELECT FirstName, LastName
FROM Members
WHERE FirstName LIKE @FirstName AND LastName = @LastName
-- If not listed return 1
IF @@rowcount = 0
BEGIN
RETURN 1
END
-- If more than one listing return 2
SELECT FirstName, LastName
FROM Members
WHERE FirstName LIKE @FirstName AND LastName = @LastName
IF @@rowcount > 1
BEGIN
RETURN 2
END
----------------------------
Sebastian
---------------------------------------------------------------------------
---
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.