|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, November 19, 2012 10:01 PM
Points: 33,
Visits: 154
|
|
Hi,
Please let me know where to find information regarding User-Login Mapping inside an instance of SQL Server 2005. As part of a SQL Server Consolidation I am moving dbs from n Sql Server instances and also transferring logins using sp_heaxadecimal and sp_help_revlogin scripts. I want to make sure that the original User-Login mapping is intact.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, February 28, 2013 1:54 AM
Points: 1,325,
Visits: 1,376
|
|
Hello,
The DB level Catalogue View sys.database_principals will give you details regarding DB Users (per DB). This can be jopined with the Server level (Login) information contained in sys.server_principals
Regards,
John Marsh
www.sql.lu SQL Server Luxembourg User Group
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, November 19, 2012 10:01 PM
Points: 33,
Visits: 154
|
|
What to join these tables on? How to find the User-Login Mapping from these tables?
TIA
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, February 28, 2013 1:54 AM
Points: 1,325,
Visits: 1,376
|
|
Hello Again,
sys.server_principals gives you the Server Logins and sys.database_principals gives you the DB Users in the selected DB.
Joining on the sid gives you the mapping (for one DB) e.g. Select * From sys.server_principals ssp Inner Join sys.database_principals sdb On (sdb.sid = ssp.sid)
Regards,
John Marsh
www.sql.lu SQL Server Luxembourg User Group
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, November 19, 2012 10:01 PM
Points: 33,
Visits: 154
|
|
Hello Sir,
Yes, that works Precisely .
Thanks a lot :)
|
|
|
|