Marcus Aurelius
asked on
SQL Server 2012 - How to Grant Access to a Schema for ALL USERS?
What is the syntax for me Granting Access to a newly created SCHEMA? I want all users to be able to do anything within this Schema.
If your Public server role is active:
GRANT CONTROL ON SCHEMA :: YourSchema TO PUBLIC;
Hi,
Russell Fox is right, you can also use it:
Granting SELECT permission on schema Person to database user JILL
Russell Fox is right, you can also use it:
Granting SELECT permission on schema Person to database user JILL
GRANT CONTROL ON SCHEMA :: YOURSCHEMA TO JILL
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
GO
CREATE ROLE [SchemaAccess] AUTHORIZATION [YourSchemaNameHere]
GO
ALTER AUTHORIZATION ON SCHEMA::[YourSchemaNameHer
GO
--or to create new schema
CREATE SCHEMA [YourSchemaNameHere1] AUTHORIZATION [SchemaAccess]
GO
--then just add all users you want to that [SchemaAccess] DB Role - you can put this in a dynamic sql.
sp_addrolemember 'SchemaAccess', 'User1'
sp_addrolemember 'SchemaAccess', 'User2'
...
sp_addrolemember 'SchemaAccess', 'UserN'