how to write store procedure for login check

  • how to write store procedure for login check

    37 minutes ago | LINK

    here iam having two tables

    table1

    table name tblLogin

    tblLogin

    LoginId

    Name

    Password

    MemberId

    table2

    table name tblmembers

    MemberId

    FirstName

    LastName

    Gender

    DOB

    Email

    Mobile

    Phone

    AddressLine1

    AddressLine2

    Country

    City

    ZipCode

    here i just want to check

    username

    password

    user type

    and after values are checked it has to display related row

    like this

    loginid

    MemberId

    FirstName

    LastName

    Gender

    DOB

    Email

    Mobile

    Phone

    AddressLine1

    AddressLine2

    Country

    City

    ZipCode

  • You can do this by just asking for the data row, in your application, if you dont get any results, you know the login failed

    CREATE PROCEDURE [dbo].[sp_check_login]

    @username VARCHAR(100),

    @password VARCHAR(50)

    AS

    SELECT l.loginid, m.*

    FROM tblLogin l INNER JOIN tblMembers m

    ON l.memberid = m.memberid

    WHERE l.name = @username AND l.password = @password

  • thanks a lot your code was working perfectly

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply