I have create login called limited_a and then I created user for limited_a called limited_u for the databse test_db. I have table t1, t2, t3, t4 and user limited_u has select permission over only t1 and t2 and their is a view called get_t3 which retrieve the data from the table t3 and a procedure called update_t4 that update the data in the table t4 .As we know user limited_u don't have access to the table t3 and table t4 but still it can manipulate the data indirectly using the view of procedure or any other methods like functions. I need to restrict the user limted_u. How can a achieve that restriction over the user. I cant restrict the user from accessing the procedures or view but I need to restrict the user from accessing the tables through view and procedures.
I already try using alter authorization with this I can achieve that but then it revoke the permission from other user. I tried deny , revoke permission over tables but it still user can access the tables through view or procedures
Here's how you can restrict a database user from accessing tables indirectly through views or procedures in SQL Server:
Grant Permissions on Views and Procedures:
Example:
T-SQL:
T-SQL:
In this scenario, the SalesUser can access customer names and IDs through the CustomerList view, but they cannot directly access the Customers table and potentially sensitive information like email addresses and phone numbers.
Additional Techniques:
Remember: