Sunday, March 11, 2012

Adding permissions to New Database

Hi,

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.

Does anybody has any suggestions ?

Thanks in advance,

Sven Peeters
Belgiumif you know what you are doing

Indeed

Does anybody has any suggestions ?

Yeah, don't do what you're doing...

What's with the dynamic database creation anyway?

What is this for?|||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.

Thnx in adv,

Sven Peeters
Belgium|||It's an external app that generates these DB's ( that are deleted after a while

Just curious...is this a third party app or an in house external app?

If it's 3rd party, what is it?

And how do you know what users are suppose to have access to which databases.

How do they not step on their own ducks when creating the dbs..are they timestamped?

What about the logins? Are these new users or old users?

No comments:

Post a Comment