CREATE PROCEDURE IsValidMember
@inID nvarchar (8),
@inpassword nvarchar(30)
AS
IF (
	SELECT Count(ii.MemberID) 
	FROM IDInfo ii JOIN ExpiryDates ed
	ON ii.MemberID = ed.MemberID 
	WHERE ii.MemberID=@inID AND ii.MemberPW = @inpassword
	AND ed.ExpiryDate >= GETDATE()
	) > 0
	RETURN 1
ELSE
	RETURN 0