June 6, 2011 at 8:18 am
Please give me an example of a T-SQL Statement that does user maping
June 6, 2011 at 8:31 am
Not really sure what you trying to do but here is a start.
select * From fn_my_permissions(NULL, 'DATABASE')
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
June 6, 2011 at 10:29 am
It is possible to map a Login to a Database in the Management Studio by right clicking on the Login and then selecting properties, then in the left Menu "Select a Page", select User Mapping and then select the database on the right that you want the login mapped to.
Is there a way to accomplish this via T-SQL?
June 6, 2011 at 10:42 am
Are you wanting to see what access a particular user has for each database? You can run the script I gave you above in the context of the login. Is that what you mean?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
June 6, 2011 at 10:43 am
I am assuming you are not familiar with the "Script" button in the SSMS Login Properties dialog (and most other dialogs in SSMS).
Make the changes in the SSMS dialog and instead of clicking OK, click the Script button on the dialog and see what SSMS would do if you click OK in a new query window.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
June 6, 2011 at 4:39 pm
No I actually want to map a login that I created to a database
June 6, 2011 at 4:40 pm
I need the T-SQL Statement or a stored procedure that maps a login to a database.
June 6, 2011 at 4:54 pm
Please re-read my post. SSMS will help you.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
June 6, 2011 at 5:38 pm
Thank you very much I found my solution.
June 6, 2011 at 5:39 pm
How do I mark this as solved?
June 6, 2011 at 6:18 pm
martin.s.ransome (6/6/2011)
How do I mark this as solved?
It's not really that kind of forum, but in a way you just did
Happy you got what you needed, thanks for posting back!
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy