March 24, 2009 at 10:43 am
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.
March 24, 2009 at 11:08 am
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
March 24, 2009 at 11:37 am
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