Encrypt Function Problem

  • Hi

    I have a login table with following fields and data

    Login

    LoginID varchar(8)

    Password varchar (8)

    The Data is table is

    Loginid Password

    Bill Gates

    Tick Tick123

    Now if I am running the query :

    select * from login where loginid='Bill' and Password=ENCRYPT('GATES'), the query works.

    It should not work as the data in password field is not encrypted and both should not match.

    Can anybody will provide the answer?

    Thanks

  • I ran this:

    create table Logins

    (

    LoginID varchar(8),

    [Password] varchar (8)

    )

    go

    insert logins select 'Bill', 'Gates'

    insert logins select 'Tick', 'Tick123'

    go

    select * from logins

    go

    select * from logins where loginid='Bill' and [Password]=ENCRYPT('GATES')

    go

    drop table Logins

    No rows returned for the second query.

    Steve Jones

    steve@dkranch.net

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

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