I tried doing this
sp_addrole 'db_alterview', 'dbo'
--Add member to role
sp_addrolemember 'db_alterview', 'testUser'
--grant permission to create view
GRANT CREATE VIEW TO [db_alterview];
GRANT SELECT ON SCHEMA::[dbo] TO [db_alterview];
I was able to select from table using the testUser but when I tried creating view this is the error I got:
Msg 2760, Level 16, State 1, Procedure vw_test, Line 3
The specified schema name "dbo" either does not exist or you do not have permission to use it.
Not sure what I am missing... I want the testUser to be the member of the db_alterview ROLE and that role should be able to create, alter and drop VIEWs...
Thanks,
Laura