How to get Database Owner?

  • How do I query a sql server database to get the owner of the database? Which data dictonary views/tables have the information?

  • sp_helpdb

    Or

    
    
    SELECT name, sid, SUSER_SNAME(sid)
    FROM master..sysdatabases

    --Jonathan



    --Jonathan

  • quote:


    sp_helpdb

    Or

    
    
    SELECT name, sid, SUSER_SNAME(sid)
    FROM master..sysdatabases

    --Jonathan


    Why do you need an extra '.' when querying from sysdatabases

  • Because he is not inserting the table owner name. If he used master.dbo.sysprocesses then he wouldn't need the double '..' DBO is assumed if the owner(schema) not specified.

    Hope this helps (HTH)

    Michelle



    Michelle

  • thank you

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply