Does the privilege granted for a view also handle for underlying relations or not?

Does the privilege granted for a view also handle for underlying relations or not?

To use a view, you require appropriate privileges only for the view itself. You do not require privileges on base objects underlying the view. Views add two more levels of security for tables, column-level security and value-based security: A view can provide access to selected columns of base tables.

How do I grant access to view?

For the existing view, you can go to the Properties of the view in SSMS, add users in the Permissions, and then grant select permission in the permissions list. Or use the following statement to grant user permissions: use YourDB. GRANT SELECT ON OBJECT::[schema].

How do I grant permission to select?

right click on table and go to properties -> permissions tab -> click Add -> browse the user to whom u want to give the permission -> click ok -> now u will find various permissions which u can grant -> in tht tick on select checkbox under grant column.

How do I grant select insert update and delete privileges in SQL Server?

1 Answer

  1. GRANT SELECT,UPDATE,INSERT,DELETE ON dbo. table TO user;
  2. GRANT SELECT,UPDATE,INSERT,DELETE ON SCHEMA::dbo TO user; Ideally, though, you would not allow ad hoc DML against your tables, and control all DML through stored procedures.
  3. GRANT EXEC ON dbo. procedure TO user;
  4. GRANT EXEC ON SCHEMA::dbo TO user;

What happens if I grant select permission on a view?

The net result is non-functional, for I end up still granting access to sensitive data to the wrong users, as well as annoying, for it is easy to forget one object and the users come back to complain that the view “doesn’t work”.

How to grant select access to a user?

Granted SELECT access to the user on that view, and NOT to any of its tables. User was successfully able to query the view and not the tables. Created a view in DB B, joining tables in this DB together with the view in DB A.

Why is the user able to select the view?

The view was created exactly because the user can’t select the tables. I’ve read https://stackoverflow.com/questions/368414/grant-select-on-a-view-not-base-table and http://msdn.microsoft.com/en-us/library/ms188676.aspx and still it is not working. If I do a GRANT SELECT TABLE TO USER to all tables, the user is able to select the view.

Do you need permission to select table in SQL Server?

The SELECT permission was denied on the object ‘ [table name]’, database ‘ [database name]’, schema ‘dbo’. Does the user need to be granted permission for any tables that the stored procedure uses?