Question

When I attach a database I would like for several users to be created on it and for them to be assigned to certain fixed database roles. Any way to ensure that this happens automatically (potentially for hundreds of databases being attached at one time) or are there any tools / utilities out there for this sort of thing?

If there's no way to do this for attaching databases, is there a way to do it for newly created databases? For example, if I add the users and the roles to the model database, will those objects and membership be inherited by newly created databases? It doesn't seem to work so far.

No correct solution

OTHER TIPS

A way to handle this by an activation initiated via the SQL Server Service Broker Event:

Implementing Internal Activation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top