DDL triger to grant select permission for new table/view

  • Dears,


    Plz help with this topic- I need to grant permission for new table/views created in one schema when this are just created

    Thanks in advance,


  • Why do you need to trigger this.  Why not just grant SELECT at the SCHEMA level instead of the OBJECT level save the overhead of a trigger firing every CREATE?

  • So does the USER not have permission to SELECT on the schema? If you need a USER/ROLE to be able interact with a new object, you normally set that in same batch you do the CREATE statement. Why not do that?

    A DDL trigger to do this feels like the wrong idea (aka an XY problem). What are you actually trying to achieve here?


    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.

  • Yeah, give the permission of a given role to a given schema and be done. Sounds like you're trying to dig a hole.

    The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
    Theodore Roosevelt

    The Scary DBA
    Author of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

Viewing 4 posts - 1 through 3 (of 3 total)

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