Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to Return 1 true if exist SQL StoreProcedure.
Posted
Updated 18-May-12 22:28pm
v2
Comments
Maciej Los 19-May-12 17:47pm    
What you mean? I can't understand... Please, be more specific.

1 solution

One way to simplify this could be:
SQL
CREATE PROCEDURE Checkuser 
  @User varchar(34),
  @intOutput int OUTPUT
AS
BEGIN
   SET @intOutput = (SELECT COUNT(*) FROM aspnet_Users Where UserName = @User);
END
go

That should return the amount of users matching in the table. If the user name is unique, the result is 0 or 1.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900