SQL Server undocumented stored procedure to get information on login mapping name
They say better not to use UNDOCUMENTED stored procedures, which is true in the aspect when any Service Pack or version is released that may not be included and your task might have issues in working out.
Similar to this I was going through various methods to get information on login mapping name since SQL Server 2000, by using PROFILER and so on. Found that using undocumented stored procedure called sp_MSloginmappings you can get login information that is mapped.
If you do not provide a Login Name, then it will iterate all Login names and will list down their user name mappings in all databases. It is an excellent undocumented feature to find out all the mappings of a given login name.
Following is an example usage of this stored procedure:
exec master..sp_MSloginmappings ‘NT AUTHORITY\BUILTIN ADMINISTRATORS’
**__________________________________**
SQL Server MVP, Sr. DBA & industry expert.
-
Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it. It is also a power and you will gain by sharing it.