• subscribe
August 22, 2001 12:00 AM

Using Sysxlogins to Retrieve Objects

SQL Server Pro
InstantDoc ID #21754

What's the easiest way for me to retrieve a list of stored procedures that a named Windows NT login account owns and that Enterprise Manager displays? I want to wrap code around the list, run the code in Query Analyzer, then change the object owner to dbo. Would translating an NT login account to the SID and joining sysxlogins to the sysobjects or sysdatabases system table help?

Master.dbo.sysxlogins exposes the SID-to-name mapping for valid logins. So, you can easily write a join query that uses sysxlogins to retrieve login names, then find matching objects such as stored procedures in a database.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here