Last post Jan 02, 2017 01:26 PM by 0belix
Jan 02, 2017 01:07 PM|ronron555|LINK
how do i chexk in my stored procedures that the user name
that the user entered in only alpabetic and that the password is only numbers
should i do the check in my asp.net code or i the SP?
SET NOCOUNT ON;
DECLARE @UserId INT, @LastLoginDate DATETIME
SELECT @UserId = UserId, @LastLoginDate = LastLoginDate
FROM Users WHERE Username = @Username AND [Password] = @Password
IF @UserId IS NOT NULL
IF NOT EXISTS(SELECT UserId FROM UserActivation WHERE UserId = @UserId)
SET LastLoginDate = GETDATE()
WHERE UserId = @UserId
SELECT @UserId [UserId] -- User Valid
SELECT -2 -- User not activated.
SELECT -1 -- User invalid.
Jan 02, 2017 01:26 PM|0belix|LINK
it on the SP, will not only require the form to be posted, and also a lot of code on the SP which is not what the database framework was designed for, hence not being optimized to do it.