How are usernames checked?

  • Hi there,

    How are new usernames actually checked? It might lead to irritations when you allow

    Jonathan and

    jonathan

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Hi Frank,

    I feel usernames should not be case-sensitive...

    Not a solution, just my opinion

    Sachin


    Regards,
    Sachin Dedhia

  • I am going to register now as frank kalis. 



    --Jonathan

  • ...no problem with me, but I was just wondering.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • ok...was thinking of a solution to this on my way back to home yesterday...

    how abut this...

    have 2 fields that will store the total of ASCII values of small alphabetes and capital.

    username LowerASCII UpperASCII

    frank  530  0 

    jonathan 855  0

    sachin  630  0

    Frank  428  70 

    Jonathan 749  74 

    Sachin  515  83

    franK  423  75 

    FranK  321  145

    FrAnK  224  210

    now the filter condition will be

    username = ? AND smallASCII = ? AND bigASCII = ?

    to say,

    username = 'FrAnK' AND smallASCII = 224 AND bigASCII = 210

    Not sure if the combinations will lead to any duplicate totals!!!

    Hope this is of some help...

    Sachin

     


    Regards,
    Sachin Dedhia

  • I dont think Im doing any checking. That good or bad? We use email address as the login id (though there is really an ident on the row that is the true key for those who care). Is having two Franks bad? I could enforce no duplicate names easily enough if that is good enough...?

  • No problem with me, as long as all post are of formal and textual quality.

     

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Aha!  So the user name (login name, screen name, full name; whatever you decide to call it) is no longer a unique identifier.  It's now just a free field (Full Name in the profile form) and the email (no longer exposed in one's profile) has replaced it as the natural primary key.  So I can change my Full Name to anything I like ("Frank Kalis", "Andy Warren", etc.) and that will be the tag on all my posts...

    I don't think this is a good idea.    Perhaps one's email (as the natural primary key) should instead be the tag on one's posts, or, if that is felt to expose too much, then one's "screen name" should be a new column that is checked as unique (and case insensitive) and not modifiable. 



    --Jonathan

  • Perhaps. I agree we dont want 100k Franks running around - 50k maybe, but 100k would be too many. Will look at it when I can.

  • Perhaps. I agree we dont want 100k Franks running around - 50k maybe, but 100k would be too many

    Do I need to understand this joke?

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • To much luxury is not good

    Maybe this will help :

    create table T_SQLServerCentralUsers(uidnr int identity(1,1) primary key,

    uAlias varchar(128)  COLLATE SQL_Latin1_General_CP1_CS_AS not null,

    uDtMember datetime not null default getdate()

    )

    go

    alter table T_SQLServerCentralUsers

    add constraint U_uAlias unique nonclustered ( uAlias )

    go

    set nocount on

    insert into T_SQLServerCentralUsers (uAlias) values('jonathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('Jonathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('jOnathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('joNathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('jonAthan')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Frank')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('frank')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Andy')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Brian')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Alan')

    go

    set nocount off

    select * from T_SQLServerCentralUsers

     update T

     set uAlias = T.uAlias + '_' + convert( varchar,S.Counter)

    select T.uidnr, T.uAlias + '_' + convert( varchar,S.Counter) as NewAlias

    from T_SQLServerCentralUsers T

    inner join

     (select

     (select count(*) as Counter --C.uAlias COLLATE Latin1_General_CI_AI,

      from T_SQLServerCentralUsers C

      where C.uAlias COLLATE Latin1_General_CI_AI = sT.uAlias COLLATE Latin1_General_CI_AI

        and C.uDtMember < sT.uDtMember

      

      group by C.uAlias COLLATE Latin1_General_CI_AI

     -- having count(*) > 1

    &nbsp Counter

     --where sT.uAlias COLLATE Latin1_General_CI_AI = subsel.uAlias

     ,sT.*

     from T_SQLServerCentralUsers sT

       ) S

     on T.uidnr = S.uidnr

    and S.Counter is not null

    then

    Send a notification to the altered aliasses email-adres with justification that the oldest member kept the name and ony sequence number is added

    Alter table T_SQLServerCentralUsers

    drop constraint U_uAlias

    go

    Alter table T_SQLServerCentralUsers

    alter column uAlias varchar(128)  COLLATE SQL_Latin1_General_CP1_CI_AS not null

    alter table T_SQLServerCentralUsers

    add constraint U_uAlias unique nonclustered ( uAlias )

    select *

    from T_SQLServerCentralUsers

    TEST IT

    Accept my nondisclosure

    Read my disclaim anything notice

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution πŸ˜€

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I get this error

    Server: Nachr.-Nr. 170, Schweregrad 15, Status 1, Zeile 20

    Zeile 20: Falsche Syntax in der NΓ€he von '*'.

    which translates to

    Line 20: Wrong syntax near '*'

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • oops uncommented to much :

    --Maybe this will help :

    --drop table T_SQLServerCentralUsers

    go

    create table T_SQLServerCentralUsers(uidnr int identity(1,1) primary key,

    uAlias varchar(128)  COLLATE SQL_Latin1_General_CP1_CS_AS not null,

    uDtMember datetime not null default getdate()

    )

    go

    alter table T_SQLServerCentralUsers

    add constraint U_uAlias unique nonclustered ( uAlias )

    go

    set nocount on

    insert into T_SQLServerCentralUsers (uAlias) values('jonathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('Jonathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('jOnathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('joNathan')

    waitfor delay '00:00:05'

    insert into T_SQLServerCentralUsers (uAlias) values('jonAthan')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Frank')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('frank')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Andy')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Brian')

    go

    insert into T_SQLServerCentralUsers (uAlias) values('Alan')

    go

    set nocount off

    select * from T_SQLServerCentralUsers

    go

     update T

     set uAlias = T.uAlias + '_' + convert( varchar,S.Counter)

    --select T.uidnr, T.uAlias + '_' + convert( varchar,S.Counter) as NewAlias

    from T_SQLServerCentralUsers T

    inner join

     (select

     (select count(*) as Counter --C.uAlias COLLATE Latin1_General_CI_AI,

      from T_SQLServerCentralUsers C

      where C.uAlias COLLATE Latin1_General_CI_AI = sT.uAlias COLLATE Latin1_General_CI_AI

        and C.uDtMember < sT.uDtMember

     

      group by C.uAlias COLLATE Latin1_General_CI_AI

    ) as  Counter

     ,sT.*

     from T_SQLServerCentralUsers sT

    ) S

     on T.uidnr = S.uidnr

    and S.Counter is not null

    go

    -- then

    -- Send a notification to the altered aliasses email-adres with justification that --- the oldest member kept the name and ony sequence number is added

    Alter table T_SQLServerCentralUsers

    drop constraint U_uAlias

    go

    Alter table T_SQLServerCentralUsers

    alter column uAlias varchar(128)  COLLATE SQL_Latin1_General_CP1_CI_AS not null

    alter table T_SQLServerCentralUsers

    add constraint U_uAlias unique nonclustered ( uAlias )

    select *

    from T_SQLServerCentralUsers

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution πŸ˜€

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Aah, now it's working.

    Looks interesting. Too much free time today?

    I like these emoticons

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • -- edit post -- is not working ??

    also add this at the bottom of the script :

    insert into T_SQLServerCentralUsers (uAlias) values('jonathaN')

    results in :

    Server: Msg 2627, Level 14, State 2, Line 1

    Violation of UNIQUE KEY constraint 'U_uAlias'. Cannot insert duplicate key in object 'T_SQLServerCentralUsers'.

    The statement has been terminated.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution πŸ˜€

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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