Login

  • Hi,

    I am notr getting clear with the difference between a login, user and a role.

    Can anybody receomend any website where i can find this.

    Thanks in adavance. 🙂

  • [Quote]I am notr getting clear with the difference between a login, user and a role.[/Quote]

    A LOGIN is an account that allows you to connect to a specified instance of SQL Server.

    A USER is an account that allows a login to connect to a specified database. A user is identified in the system by a USERID.

    A ROLE is a collection of rights, privileges, etc that can be assigned by an ADMIN to a USER.

    I hope I have helped.


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • Login ID:A login ID is the account identifier that controls access to any SQL Server 2000 system. SQL Server 2000 does not complete a connection unless it has first verified that the login ID specified is valid. Verification of the login is called authentication.

    Users:A user identifier (ID) identifies a user within a database. All permissions and ownership of objects in the database are controlled by the user account. User accounts are specific to a database; the xyz user account in the sales database is different from the xyz user account in the inventory database, even though both accounts have the same ID. User IDs are defined by members of the db_owner fixed database role.

    Roles:A database role applies to a single database, and it includes a list of Windows NT® 4.0 or Windows® 2000 user accounts and groups. The specifications in a database role apply to end users' access to objects on an Analysis server while they are connected to it from a client application. Database roles are not used to grant or deny administrative access to objects.

  • Hi,

    The above information have helped.

    Now if i have XYZ login and under it i have 10 users.

    Now how would SQL diferrentiate between different users. I have one login and i want different users to login with different roles.

    So how does the SQL server inderstand which users have connected.

    Does the SQL takes the windows users for different users for a login..

  • Good questions! It took me a while to make the distinction, but I have yet to define anything other than one user = one login. So I am interested in that distinction also.

    The other thing about roles (perhaps it was mentioned before and I just missed it) is that they define Securables. I typically define two types of roles (perhaps just because I don't know any better -- if so I am sure someone here will show me a better way) a user group role and a permissions role. For example:

    Role Auditors (user group): Defines the users who belong to the group of users who are auditors (do audit stuff).

    Role SeeAudits (permissions): Membership includes the Auditors user group, and grants execute permissions for the stored procedures, and select permissions for the views required to do audit checks.

  • Harsha Bhagat (4/20/2008)


    Hi,

    The above information have helped.

    Now if i have XYZ login and under it i have 10 users.

    Now how would SQL diferrentiate between different users. I have one login and i want different users to login with different roles.

    So how does the SQL server inderstand which users have connected.

    Does the SQL takes the windows users for different users for a login..

    You can link users to logins with the following: http://msdn2.microsoft.com/en-us/library/ms174378.aspx

    I am not sure if you can link multiple users to a single login (I have not encountered a reason to do that). To accomplish what you are asking, I have either identified the user in the application (front end) code and controlled their permissions in the application logic or created multiple logins with different users' permissions for each one. Sorry I don't have more definitive help for you.

    ----------------------------------------------------------------------------
    "No question is so difficult to answer as that to which the answer is obvious." - George Bernard Shaw

  • Hi All,

    I duplicated the issue.....I created a new login with a name..."newlogin".(as every one said that Login is used to log in to the sql server instance)....then I created 3-4 different users with in different databases...and mapped them to the login "new login"....can any one tell me that how I can log in to the database with login "newlogin" and user "newuser"..b'coz each time I am loging into the database it is taking the default user "dbo".

    Thanks,

    Ahmad

    Regards,
    [font="Verdana"]Sqlfrenzy[/font]

  • I am not sue if that really gets you any thing other then an Alias. If you look at current activity after logging in it always shows the login name not the name in the database.

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

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