what are the permissions needed to create and modify databases and to create users

답변됨 what are the permissions needed to create and modify databases and to create users

  • 2012년 8월 15일 수요일 오전 2:06
     
     

    Hi All,

    I want to know which permissions are required to create user,create database and modify database in sql server


    Maheshwar Reddy

    • 이동됨 Tom Phillips 2012년 8월 15일 수요일 오후 9:34 Security question (From:SQL Server Database Engine)
    •  

모든 응답

  • 2012년 8월 15일 수요일 오전 2:11
     
     답변됨

    Here is the exhaustive list of database engine permissions, which cover each of these scenarios:

    http://msdn.microsoft.com/en-us/library/ms191291

    Thanks,
    Sam Lester (MSFT)


    My Blog

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • 2012년 8월 15일 수요일 오전 2:13
     
     답변됨

    The permissions hierarchy picture also helps explain a bit more:

    http://msdn.microsoft.com/en-us/library/ms191465

    Thanks,
    Sam Lester (MSFT)


    My Blog

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • 2012년 8월 15일 수요일 오전 3:25
     
     

    The permissions hierarchy picture also helps explain a bit more:

    http://msdn.microsoft.com/en-us/library/ms191465

    Thanks,
    Sam Lester (MSFT)


    My Blog

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    good picture!
  • 2012년 8월 15일 수요일 오후 12:26
     
      코드 있음

    Hi Masheshwar,

    1. You need db_creator rights because the members of this fixed server role can create databases, and can alter and restore their own databases.
    2. You need securityadmin because the members of this fixed server role can manage logins and their properties. They can GRANT, DENY, and REVOKE server-level permissions. They can also GRANT, DENY, and REVOKE database-level permissions. Additionally, they can reset passwords for SQL Server logins.
    3. You need db_securityadmin fixed database role so that youcan modify role membership and manage permissions within the database.

    You can grant these permissions as follow:

    USE [master]
    GO
    EXEC master..sp_addsrvrolemember @loginame = N'<SpecifyUserName>', @rolename = N'dbcreator'
    GO
    EXEC master..sp_addsrvrolemember @loginame = N'<SpecifyUserName>', @rolename = N'securityadmin'
    GO
    CREATE USER [<SpecifyUserName>] FOR LOGIN [SpecifyUserName]
    GO
    EXEC sp_addrolemember N'db_accessadmin', N'<SpecifyUserName>'
    GO


    Regards,

    Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)

    http://basitaalishan.com

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.


    • 편집됨 Basit Farooq 2012년 8월 15일 수요일 오후 12:27
    •