UserName vs LoginName in DB

  • What is the true meaning and purpose of having both the 'LoginName' and 'UserName' when creating a user account? Because, when say you need to drop a user, you need to specify the user's 'Name_IN_DB', and, because a Login can be named something totally difference because of the 'UserName' option, it can tricky unless you view by SID. But, what is the overall purpose and the benefit of using this option....?

  • Hi,

    The simple difference between a user and login is

    Login is used to gain entry in to server

    User is used to gian entry to the database

  • Right. But what is the benefit to make the IDs different? Example could be, I have a Login on the Server as 'TOPHER'. Within a database, I have a login of 'TOPHER', but I set the username to 'MIKE'. Why is the benefit to set the 'username' different than the loginname?

  • I cannot think of a benefit. You are allowed to do it by the syntax bit I have never had a case where I have needed the loginname different to the user name for a SQL authenticated id.

    Its probably just allowed because why place the restriction that they must be the same?

    ---------------------------------------------------------------------

  • The benefit is there are times when certain application require a particular username. However, especially on the Windows side, your corporate naming standard doesn't match the name the application wants. But you still must have a Windows service account. In this case, you could use the different user name and be okay.

    Case in point:

    Corp standard: svcSomeName

    App requirement: AppName

    Specifying a username that is different from the loginame accomplishes this.

    K. Brian Kelley
    @kbriankelley

Viewing 5 posts - 1 through 4 (of 4 total)

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