7 thg 7, 2017

Create a stored procedure to check if username is in use

 Create a stored procedure to check if username is in use. This stored procedure returns 1 if the user name is already taken, else 0.

Create procedure spUserNameExists
@UserName nvarchar(100)
as
Begin
Declare @Count int

Select @Count = Count(UserName) 
from tblRegistration
where UserName = @UserName

If @Count ] 0
Select 1 as UserNameExists
Else
Select 0 as UserNameExists
End


tham khao tai day

Create a stored procedure to check if username is in use Rating: 4.5 Diposkan Oleh: http://pdunoteit.blogspot.com/