You must Sign In to post a response.
  • Category: SQL Server

    Restrict select access on view

    I have a DB view and I want to restrict select access for some users?
    Please let me know how to do this and how can test it to make sure it work?

  • #762471

    Go to Sql server -> Login -> select user -> right click -> Properties then you can put security option.

    Name : Dotnet Developer-2015
    Email Id :

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #762474
    Hello Pramod,

    I am agreed with Mr. Kumar's answer.

    You can also go through reference of MSDN Library :

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • #762492

    You can make only particular user to access particular view.
    First create a new user and grant permission for the view he should see, like below

    create login newlogin with password = 'newuser'

    use sridhar //database name

    create user user1 for login newlogin

    grant select on empdetails to user1

    If the user login with id= newlogin and password=newuser then he can see the view under views folder.

    Now create another login user like below with out grant for view.

    create login newlogin2 with password = 'newuser1'

    use sridhar //database name

    create user user2 for login newlogin2

    If user login with id=newlogin2 and password=newuser1 then he cannot see the view under views folder.

    Sridhar Thota.
    Editor: DNS Forum.

    Delete Attachment

  • Sign In to post your comments