问题
We have a SQL Server 2012 instance which is the database for our security system. Now we have a scenario where we want to allow another team our SQL Server to select certain records, ie we created four views for them for their requirements.
But, we don't want to provide or list all our tables to them but only allow these four views to see and query in our system. As I go through many documents it's clear that we can do it through making our SQL Server as a linked server.
What's the best way to do it through a linked server?
回答1:
Are the views in a specific schema? Try to grant the users access to that schema, so that they can only read and see meta from it.
https://docs.microsoft.com/en-us/sql/relational-databases/security/metadata-visibility-configuration
回答2:
we don't want to provide or list all our tables to them but only allow these four views to see and query in our system.
You don't need linked server to accomplish this.
All you need is to grant SELECT
permission on these 4 views.
When you create a user in a database and don't grant any permission to it, it does not see any user table/view at all. And it will be able to see and query only those objects on which you'll grant the permissions
来源:https://stackoverflow.com/questions/46515705/how-to-make-your-server-as-linked-server-for-selected-views