I am trying to set up a set of SQL logins (one for each developer) on a server who can have access to a given set of databases, currently the setup is as follows:
Login 1: db_owner of databases 1, 2, 3 and 4
Login 2: db_owner of database 5
(this is because this login is used by someone else who shouldn't have access to the other databases).
Is there a way to add a set of new logins that would have access to all the mentioned databases without changing the existing logins? As far as I know you can't have multiple db_owner
's of a database.
(I know that using sa
would do the job, but the databases are actually hosted on a third parties server with other customer's databases, so we can't use that!)
Best Answer
As per this question
You can create a login using below acript and map it to user and then grant necessary privileges to user. Granting privilege to SQL server user is complex topic and you must read this article and this for understanding it.
SQL Server, requires ALTER ANY LOGIN permission on the server or membership in the securityadmin fixed server role to create login.