Some tables permission on some databases

  • We have

    Server 1 - 3 databases db1,db2,db3

    - having same table , say table1,table2,table3,table4,table5,table6....table100

    Server 2 - 4 databases db1,db2,db3,db4 - having same table , say table1,table2,table3,table4,table5,table6.....table50

    We want to give select,update permission for db1, db2 on table table1,table2....table50 on server1

    We want to give select,delete permission for db1, db4 on table table1,table2....table30 on server2

    Does anyone has script?

  • this is the approach , you can take

    use [TestDB]

    GO

    GRANT SELECT ON [dbo].tablename TO [loginname]

    GO

    use [TestDB]

    GO

    GRANT UPDATE ON [dbo].tablename TO [loginname]

    GO

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Take this a step further. Set up roles in your databases. Grant the permissions to the roles. Then add a user to the necessary roles.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I would set up AD group and grant permission to the group and add users to that group.

    EnjoY!
  • GTR (3/12/2010)


    I would set up AD group and grant permission to the group and add users to that group.

    And then put that group in a role in SQL Server 😀

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • CirquedeSQLeil (3/13/2010)


    GTR (3/12/2010)


    I would set up AD group and grant permission to the group and add users to that group.

    And then put that group in a role in SQL Server 😀

    May or may not, i may just give access to DB for that AD group depending on the requirement:-P

    EnjoY!

Viewing 6 posts - 1 through 5 (of 5 total)

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