SQL Server Performance

TSQL methods to display the owner of schema in a database.

Discussion in 'Other SQL Server Blogs around the Web' started by Anonymous, Aug 15, 2007.

  1. Anonymous New Member

    You can use 2 methods to get information about owner of a particular schema or set of schema(s) within the database. Using INFORMATION_SCHEMA views method (which I prefer most of the times): USE &lt;DBName&gt; GO SELECT * FROM INFORMATION_SCHEMA.SCHEMATA Using query against system catalog: SELECT s.name AS 'Schema Name', db.name AS 'Database User Name' , svr.name AS 'SQL Server Login Name' FROM sys.schemas s INNER JOIN sys.database_principals db ON s.principal_id = db.principal_id INNER JOIN sys.server_principals...(<a href="http://sqlserver-qa.net/blogs/t-sql/archive/2007/08/15/1449.aspx">read more</a>)<img src="http://sqlserver-qa.net/aggbug.aspx?PostID=1449" width="1" height="1">

Share This Page