Add user with Admin Access

  • I'm a SQL Developer, not and administrator, but a third party software company working with our DB needs access and I need to add a user and give them Admin access.

    I can't find out how to do this anywhere? I have set up a windows log in for them. Can someone please clue me it?

    Thanks!

  • What all privileges he they should get /

    What all data they can read/edit?

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • I need to give them full access to everything.

  • create a sql login ( thru security)

    in user mapping, select the database, whcih u want him to access everythign and give him

    db_owner permissions.

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • Thanks! But, I'm not a SQL Admin, I'm a developer. My Admin is not here this week and I need to give this access as soon as possible. Can you give me a little more info?

    create a sql login ( thru security) - How? Is this a script or from MGMT Studio?

    in user mapping, select the database, whcih u want him to access everythign and give him

    db_owner permissions. Again, how do I do this? don't know what user mapping is?

    Thanks again for your help!

  • djustice 20821 (4/11/2012)


    I need to give them full access to everything.

    Please define full access to everything. Do they need only access to a specific database or the entire server?

  • They need access to 2 databases, 'Test' and 'Production', but they need full access to both. By full access I mean they need to be able to access (read/Write) all tables, views, SP's etc.

    Thanks

  • djustice 20821 (4/11/2012)


    They need access to 2 databases, 'Test' and 'Production', but they need full access to both. By full access I mean they need to be able to access (read/Write) all tables, views, SP's etc.

    Thanks

    One more question, anything else on the server that they don't need access to, other databases for example?

  • Yes, there are several other DB's that they do not need access to.

  • Right click Logins, under security in SSMS for the instance, then "New Login".

    Enter the credentials (SQL or Windows type login), then on the mapping tab, select the databases they need access to. This will create a user in the databases.

    In the database, double click the user and I would suggest you build a role that provides access, but it sounds like you don't really understand much about SQL security. You can give them the db_datareader and db_datawriter roles, but I'd document this and then let the normal admin person review it and change things if needed.

  • Hope this helps:

    CREATE LOGIN [domainname\username] FROM WINDOWS; -- Replace domainname\username with the windows login you created

    GO

    USE [first_database_name]

    GO

    CREATE USER username FOR [domainname\username];

    GO

    EXEC sp_addrolemember N'db_owner', N'username'

    GO

    USE [second_database_name]

    GO

    CREATE USER username FOR [domainname\username];

    GO

    EXEC sp_addrolemember N'db_owner', N'username'

    GO

  • Great. Worked perfectly. Thanks for your help!

Viewing 12 posts - 1 through 11 (of 11 total)

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