SQL Server undocumented stored procedure to get information on login mapping name

Published 24 December 07 05:55 AM | SQL Master 

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’

Comments

# SSQA.net - SqlServer-QA.net said on January 7, 2008 4:00 AM:

They say better not to use UNDOCUMENTED stored procedures, which is true in the aspect when any Service

# Other SQL Server Blogs around the Web said on January 7, 2008 4:32 AM:

They say better not to use UNDOCUMENTED stored procedures, which is true in the aspect when any Service

Anonymous comments are disabled

About SQL Master

**__________________________________** 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.