Sunday, January 23, 2011

Unable to view SQL Server 2005 System View Definitions

I need to see the view definition for the system views sys.syslogins and sys.sysusers. I am a domain admin and logged on to the server as such. Any ideas?

  • Use the following T-SQL to view the definition of syslogins.

    USE Master
    Go
    sp_helptext 'sys.syslogins'
    

    Replace 'sys.syslogins' with 'sys.sysusers' to see the definition of sysusers.

    This, of course, assumes that your domain Admin userID has the appropriate rights within SQL Server.

    sp_helptext is an inbuilt stored procedure that can be used to view the definitions of views and stored procedures within SQL Server databases. For more information, see http://msdn.microsoft.com/en-us/library/ms176112%28SQL.90%29.aspx

    Marko Carter : Spent quite a while on Google trying to figure this out - thanks very much!
    Thomas Rushton : You're welcome!

0 comments:

Post a Comment