When a new Database is created ( some , not all. All that begins with 'PW' ) i want to add a windows-usergroup to it so they can access the DB.
Normally I could do this by adding this user to the model-db but it's not for all DB's that are added (The other DB's must not be accesible for this usergroup ).
The DB's are added by an External App so I have no control over it.
So I was thinking, no problem we can just add a trigger to the master..sysdatabases table and add if necessary the permissions.
Not -> Even with allowupdates = 1 you cannot add a trigger to a system table ( a bit overprotection from ms, should be allowed if you know what you are doing ).
I would like to avoid running a job every x time to look if a new DB has been added, the DB must be available within minutes after creation.
That's the beauty of it all, that i cannot control.
It's an external app that generates these DB's ( that are deleted after a while ).
I think they use them as temporary database with statistics or some sort.
Anyway, i cannot change anything about the app and other users must have access to this database.
Any help is welcome, otherwise I will have to use a job to do this.