Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2006
    Posts
    2

    Unanswered: identical login creation from existing login?

    I need to create a login which has the same access permissions on databases and its objects as an existing login.

    I understand in SQL Server that a login is for the instance and the user is for the database. And for each login to access a database there must be an associated user within the database.

    Example:
    login u1 has access to databases d1 and d2.
    And u1 has the dbowner privilege on d1
    And u1 has the db_datareader privilege on d2

    I want to create another login u2 which has identical privileges and access as u1.

    I need this because in the case that I am working on, this u1 login is associated with almost 30 database within the instance.

    Can somebody help me with please.

    Thank you.
    Gokul

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I would look into creating database roles.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Dec 2006
    Posts
    2
    Could you tell me which master table has information about what roles a particular login or user has on a database?

    I have seen the following...
    sysuser
    syslogins
    syspermissions
    sysdatabases

    I dont understand where to look for?

    Thank you.
    Gokul

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    If this is a "one time shot", then I'd use SQL Enterprise Manager to script the login, then a text editor to change the name. Run the modified script, and you are good to go.

    If you are going to do this frequently, you need to investigate SQL-DMO and its login management methods.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •