SQL Server Schema Owner Permissions

if i do:

CREATE SCHEMA [test] AUTHORIZATION [testuser] 

testuser doesn't seem to have any schema rights, is that correct? I considered the director owning the scheme, did you have full control over it?

What permission do I need to give testuser so that it fully controls the test circuit?

Edit: with "full control", I mean the ability for CRUD tables, views, sprocs, etc.

Edit: here is my full code:

 CREATE DATABASE [testdb] Go USE [testdb] CREATE LOGIN [andrewbdesktop\testuser] FROM WINDOWS Go CREATE USER [andrewbdesktop\testuser] FROM LOGIN [andrewbdesktop\testuser] Go CREATE SCHEMA [test] AUTHORIZATION [andrewbdesktop\testuser] Go ALTER USER [andrewbdesktop\testuser] WITH DEFAULT_SCHEMA = [test] 

thanks

+4
source share
2 answers

By default, the schema owner can

  • Granting permissions for any objects in the schema
  • Discard the circuit if it is empty.
  • Discard any object in the circuit

By default, the schema owner cannot

  • Creating objects in the circuit. DDL events are not bound to the schema level, they are limited by the database level.
+2
source

I believe that with your expression you make this user the owner of the scheme, so he should have full control over the objects in this scheme by default.

If you want a smaller control, you can make statements like:

 GRANT EXECUTE ON SCHEMA::test TO testuser GRANT INSERT ON SCHEMA::test TO testuser GRANT SELECT ON SCHEMA::test TO testuser GRANT UPDATE ON SCHEMA::test TO testuser GRANT DELETE ON SCHEMA::test TO testuser 
+1
source

Source: https://habr.com/ru/post/1308760/


All Articles