Assign view to SQL Server User


Hello friends, I need you to help me with a problem I have.

I have 2 databases (b1, b2) where from b2 I created a view (sales) that comes out of b1, which works correctly; I need to create a user that can access that view and nothing else.

The reason I created the view in b2 is that I can not create anything in b1, but only consult.

The problems that I have encountered are:

  • Assign the permissions to a 'user1' from b2 but after logging in you do not have permissions to see the view (Sales) because 'user1' does not have permissions for b1.
  • I followed a tuto which I can access in sight, but also access to b1 and b2 which I do not want the 'user1' access to that information, but only in sight (Sales)

Version: Microsoft SQL Server 2016 (SP1)

I hope you can help me, I thank you very much


I need 'user1' to access the view (Sales) and only that. - With the aforementioned tuto: In the first connection I have privileges and I access the databases b1 and b2, since b2 I created the 'user1'; when I make the second connection with 'user1' I access the view (sales) but I also have access to the tables of b1 and b2

asked by Maicoly Guerrero 18.04.2018 в 17:18

1 answer


I think something like this should work ...

Create a Role that has read permissions to b1 tables. Put your b2 user in the role and try to build the view again.

* Update the objects you manipulate between action and action


answered by 19.04.2018 в 11:18