granting create proc / func to create dbo objects

  • If you are doing this in a dev world, two ways:

    1. Let them create objects and then "mark" them for dbo status. They do this by dropping the object name in a table you set up for them. Then you ahve a job that "renames" the table to have dbo as the owner (sp_changeobjectowner) . Run the job every minute, hour, whatever.

    2. Let htem put schema/code in a table. Have a job that runs as dbo and "executes" the code. Be sure you trust the developers on this one.

    I prefer the first.

  • To create objects that will be owned by a different user, the database role db_ddladmin must be granted. To restrict what objects can be created, you may deny a statement privilege.

    Here is some example SQL:

    exec sp_addrolemember @rolename = 'db_ddladmin', @membername = 'LocalUser'

    go

    deny create table to LocalUser

    go

    SQL = Scarcely Qualifies as a Language

  • thank you all for the replies.

    I'll test the proposed paths.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data and code to get the best help

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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