if i do:
CREATE SCHEMA [test] AUTHORIZATION [testuser]
testuser
doesn't seem to have any permissions on the schema, is this correct? I thought as the principal that owns the schema, you had full control over it?
What permission do i need to grant testuser
so that it has full control over the test
schema only?
Edit: by "full control" i mean the ability to 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
By default the schema owner can
By default the schema owner cannot
I believe that with your statement, you're making that user the owner of the schema, so it should already have full control over the objects in that schema by default.
If you want more fine-grained control you can do 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With