如果用户名存在,如何返回 1,否则返回 0?这是我尝试过的。
IF EXISTS (SELECT * FROM [User] WHERE UserName = @UserName and EmailID=@EmailID)
begin
return 1;
end
else
begin
declare @CreatedOn datetime
select @CreatedOn = getdate()
insert into [User](UserName,Password,EmailID,ContactNo,CreatedOn) values(@UserName,@Password,@EmailID,@ContactNo,@CreatedOn)