Table Permissioning

  • Is there a way to create a role having insert/update/delete permissions on each table in a database in such a way that every time a new table is created, it's under the scope of that role for the mentioned operations ?

  • That would be the db_datawriter built in role. Works as you want, insert, update, delete rights on all tables.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Yeah. Sorry but I forgot to mention that due to certain restrictions we cannot use built in roles. Is there kind of parallel mechanism to implement db_datawriter ?

  • Why on earth not use the built ins?

    You could create a role that grants the permissions on the schema, then any tables added to the schema get the permissions

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • That's a strange restriction. Are you at liberty to explain? One way round it is to grant INSERT, UPDATE and DELETE on the schema(s) that contain your tables.

    http://msdn.microsoft.com/en-us/library/ms187940.aspx

    John

  • Thats what I was thinking. However then my mind started thinking ridicously for the following command:

    grant insert, update, delete on all tables to <rolename>

    Nothing sort of this, right ??? 🙂

  • The following thing works for me for granting execute permissions on all the procedures to a role:

    grant EXEC to <rolename>

    The same way i was thinking and thats how my mind started dreaming.:-)

  • sqlnaive (8/20/2012)


    Nothing sort of this, right ??? 🙂

    Did you try it?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • No Gail, Didn't tried it yet. But definitely will do.

Viewing 9 posts - 1 through 8 (of 8 total)

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