Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    3

    Question Unanswered: MSDE - Grant Permission?

    Hi all,

    If I would like to create a user with a db_owner permission & some permissions such as sp_addlogin, sp_adduser etc.

    How can I do? Would you mind to give me some examples?

    Many thanks.

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Quote Originally Posted by hilfiger
    Hi all,

    If I would like to create a user with a db_owner permission & some permissions such as sp_addlogin, sp_adduser etc.

    How can I do? Would you mind to give me some examples?

    Many thanks.

    Check sp_addrolemember , Grant, sp_addlogin in Bol its been explained very well with good examples.

  3. #3
    Join Date
    Feb 2006
    Posts
    3

    Question Grant sa permission?!

    Yes, I used sp_addrolemember, grant , etc.

    The following are my steps:
    1. use "sa" login to "master"
    2. exec sp_addlogin "abc", "abc", "master", null, null, null
    go
    3. exec sp_adduser "abc", "abc1", "db_owner"
    4. exec sp_addrolemember "db_accessadmin" , "abc1"
    go
    5. exec sp_addrolemember "db_securityadmin" , "abc1"
    go
    6. exec sp_addrolemember "db_ddladmin" , "abc1"
    go
    7. exec sp_addrolemember "db_backupoperator" , "abc1"
    go
    8. exec sp_addrolemember "db_datareader" , "abc1"
    go
    9. exec sp_addrolemember "db_datawriter" , "abc1"
    go
    9.5. grant all on sp_addlogin to abc1
    go
    10. use "abc" login into "master"
    11. exec sp_addlogin "bb", "bbpassword", "master", null, null, null
    go

    Msg 15247, Level 16, State 1, Server MIS-TOMMY\AIAB, Procedure sp_addlogin, Line
    17
    User does not have permission to perform this action.

    How can I solve this?

    Many thanks.

  4. #4
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by hilfiger
    Yes, I used sp_addrolemember, grant , etc.

    The following are my steps:
    1. use "sa" login to "master"
    2. exec sp_addlogin "abc", "abc", "master", null, null, null
    go
    3. exec sp_adduser "abc", "abc1", "db_owner"
    4. exec sp_addrolemember "db_accessadmin" , "abc1"
    go
    5. exec sp_addrolemember "db_securityadmin" , "abc1"
    go
    6. exec sp_addrolemember "db_ddladmin" , "abc1"
    go
    7. exec sp_addrolemember "db_backupoperator" , "abc1"
    go
    8. exec sp_addrolemember "db_datareader" , "abc1"
    go
    9. exec sp_addrolemember "db_datawriter" , "abc1"
    go
    9.5. grant all on sp_addlogin to abc1
    go
    10. use "abc" login into "master"
    11. exec sp_addlogin "bb", "bbpassword", "master", null, null, null
    go

    Msg 15247, Level 16, State 1, Server MIS-TOMMY\AIAB, Procedure sp_addlogin, Line
    17
    User does not have permission to perform this action.

    How can I solve this?

    Many thanks.

    Just add two lines before line 10
    exec sp_addsrvrolemember N'abc', sysadmin
    go
    EXEC sp_grantdbaccess N'abc', N'abc1'
    go

    I hope now it would be ok.
    Joydeep

Posting Permissions

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