Automate grant permissions

  • I would like to automate a process which do manuaaly now. I do get request to create a database and also give access to some logins for the database with read/write permissions.

    How would i automate this by using a store proc where it creates a database with prefix DevState_dbame and give permissions.

  • New databases when created are based on the Model database.

    Create the login that you want in all new databases in the Model DB

    From BOL

    When a CREATE DATABASE statement is issued, the first part of the database is created by copying in the contents of the model database. The rest of the new database is then filled with empty pages.

    If you modify the model database, all databases created afterward will inherit those changes. For example, you could set permissions or database options, or add objects such as tables, functions, or stored procedures

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • I understand that about model but here it is dynamic, users keep on changing, I would like to do in a proc where i can pass database name and logins as parameter.

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

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