I need to give a new login read access to all 300 databases on a server. How can I accomplish this without checking 300 checkboxes in the user mapping area?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One way would be to Set “Results to Text” on the query menu in SSMS then execute the below.
It doesn’t actually make the change but generates a script for you to review and execute.
Or you could look at
sys.sp_MSforeachdbas here or Aaron Bertrand’s improved version hereIf you are not seeing all of the characters when you run this, open the Query Options for Text and check the setting for ‘Maximum number of characters displayed in each column’. Make sure this is set to a value large enough to display all characters.