April 1, 2013 at 12:40 am
Hi,
I want create one database customize role, that role should able to do only fetching the data from SQL view (rest of objects should not able to visible) in respective database.
Please provide scripts for customize DB role.
Thanks in advance.
Pradeep.
Pradeep
April 1, 2013 at 6:17 am
it's trivially ewasy, but the most important thing is to make sure noone has sysadmin rights; you cannot hide or deny access to a sysadmin.
sql is deny by default, so if permissions to an object (table/view/proc/etc) not given to someone, they cannot see or access the objects.
USE [SandBox] --my db for users to do stuff.
CREATE ROLE [OneViewForYou]
--give my new role READ permission to one specific view
GRANT SELECT ON dbo.MyView TO [OneViewForYou]
--finally, add our user bob to the role we created
EXEC sp_addrolemember N'OneViewForYou', N'bob'
Lowell
April 2, 2013 at 3:34 am
Thanks.
Pradeep
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply