Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Granting select to all databases current and future?


Granting select to all databases current and future?

Author
Message
lbrady
lbrady
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 184
Hello, I am having a major brain malfunction!

I have a user who needs select permissions to all databases on a server. No problem. The caveat is they they are requesting access to all databases current and future.

Can I set up read access at a server level? If so, how?
SS2008SP2.

TIA
-Laura
David Webb-CDS
David Webb-CDS
SSC Eights!
SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)SSC Eights! (918 reputation)

Group: General Forum Members
Points: 918 Visits: 8584
Haven't tried this, but you could set them up with the db_datareader role in the Model database. When Model is copied as the basis for any new database, the role definition would come along.



And then again, I might be wrong ...
David Webb
Erland Sommarskog
Erland Sommarskog
SSC Eights!
SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)SSC Eights! (935 reputation)

Group: General Forum Members
Points: 935 Visits: 866
You could write a server trigger for CREATE DATABASE that adds this user to the database. I like this better than adding a user to model, because a server trigger is easier to find and notice. But I can't say that I like any of them.

But a database may also appear on the server because it was restored from a different server. Model is not going to help. Don't recall on the top of my head if there is server trigger for RESTORE DATABASE.

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45096 Visits: 39912
lbrady (9/20/2013)
I have a user who needs select permissions to all databases on a server.


From a data security aspect, I'd really want to know why that's necessary. I'd also get the head of IT to sign off on that request in writing.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
lbrady
lbrady
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 184
David Webb-CDS (9/20/2013)
Haven't tried this, but you could set them up with the db_datareader role in the Model database. When Model is copied as the basis for any new database, the role definition would come along.


Thank you! This is exactly what I need. Not sure why I couldn't think of it myself.
lbrady
lbrady
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 184
Jeff Moden (9/20/2013)
lbrady (9/20/2013)
I have a user who needs select permissions to all databases on a server.


From a data security aspect, I'd really want to know why that's necessary. I'd also get the head of IT to sign off on that request in writing.


Yes, Jeff. A valid concern. However, this department owns the server. I only support them in a very limited capacity (backups and permissions - the use of the term 'security' is purposefully omitted.) From a company standpoint, it is all development and therefore no PII.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search