Collections:
Who Is the Owner of a Schema in SQL Server
Who Is the Owner of a Schema in SQL Server?
✍: FYIcenter.com
When you create a schema in a database, SQL Server will assign a owner (a database user) to this schema. If your login name is mapped to the owner of a schema at the database level, you have the full permission on all objects in this schema.
The following tutorial exercise shows you how to see who is the owner of a schema:
-- Login with "sa" USE FyiCenterData; GO SELECT s.name, u.name AS owner FROM sys.schemas s, sys.database_principals u WHERE s.principal_id = u.principal_id; GO name owner ------------------- -------------------- dbo dbo fyi dbo guest guest ...
The last query shows that schame "fyi" is owned by "dbo".
2016-10-22, 664👍, 0💬
Popular Posts:
Where to find answers to frequently asked questions on Managing Security, Login and User in SQL Serv...
How REAL and FLOAT Literal Values Are Rounded in SQL Server Transact-SQL? By definition, FLOAT(n) sh...
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
What are binary literals supported in SQL Server Transact-SQL? Binary literals in Transact-SQL are s...