Retrieve Value in SQL

北城余情 提交于 2019-12-12 03:05:36

问题


I have to create a SSRS Report to retrieve the value according to this condition:

  • A,B,C,D,E are Five users think,
  • A as Junior developer
  • B as developer
  • C as senior developer
  • D as project manager
  • E as Sr project manager

  • A reports to B

  • B reports to C
  • C reports to D
  • D reports to E

Then:

  • when A logs in he can only see his records
  • when B logs in he can see the records for A,B and not able to see the C,D and E records
  • when C logs in he can see the records for A,B,C and not able to see the D and E records
  • when D logs in he can see the records for B,C,D and not able to see the A and E records
  • and when E logs in he can see the records for C,D,E and not able to see the A,B records

Is there any way to retrieve the value this way?


回答1:


You can try as following...

  1. Create ROLE for each user (A,B,C,D)
  2. Give permission as your need for each role . For example, B 'ROLE' can access 'B1, B2, B3' tables.

You can also do something like this...

Denying SELECT permission on a table.... The following example denies SELECT permission to the user user1 on the table Person.name in the db1 database.

USE db1;
DENY SELECT ON OBJECT::Person.name TO user1;
GO

For more information :

  1. http://technet.microsoft.com/en-us/library/ms173724.aspx
  2. http://technet.microsoft.com/en-us/library/ms188338.aspx


来源:https://stackoverflow.com/questions/19588327/retrieve-value-in-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!