Mapping Logins

  • Comments posted to this topic are about the item Mapping Logins

  • W0w! I never knew this, many thanx for that gr8 info!

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • I knew it ))) Thanks for question!

  • I thought "nice easy question for Christmas Eve" and then I saw the number of wrong answers and was surprised. Default login mapping is something I thought almost everyone would know about.

    Tom

  • TomThomson (12/24/2015)


    I thought "nice easy question for Christmas Eve" and then I saw the number of wrong answers and was surprised. Default login mapping is something I thought almost everyone would know about.

    I was wondering myself. I think this is one of those areas people assume errors rather than convenience. I think they should be right. Security should require specificity.

  • The explanation is (slightly) incorrect.

    SQL Server will not automatically map to existing users with the same name. What happens is that the (documented, in the page that's referenced in the explanation) default applies: CREATE USER xxx with no additional specification will always try to map to a login with the same name. Even if it does not exist (in which case you'll obviously get an error message).

    I do agree that it's better to be specific instead of relying on defaults. Not just here, but in all cases.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (12/24/2015)


    I do agree that it's better to be specific instead of relying on defaults. Not just here, but in all cases.

    Absolutely agree.

  • Steve Jones - SSC Editor (12/24/2015)


    TomThomson (12/24/2015)


    I thought "nice easy question for Christmas Eve" and then I saw the number of wrong answers and was surprised. Default login mapping is something I thought almost everyone would know about.

    I was wondering myself. I think this is one of those areas people assume errors rather than convenience. I think they should be right. Security should require specificity.

    I couldn't agree more. Another thing that drives me nuts is when you don't specify a default schema, SQL Server creates one of the same name for you and sets it as the default for the user bring created. I wish it didn't. Even throwing an error would be better. Of course, it's now a complete habit to always specify a default_schema, so even if they did change it, I'd still be doing it.

  • Nice one, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 9 posts - 1 through 8 (of 8 total)

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