Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    3

    Unanswered: Hide Data Across ALL Tables, Views & Stored Procedures

    Is it possible to hide certain information/rows throughout all Tables, Views, and Stored Procedures all at once so that they are not returned with the results.

    For example:

    Hide all rows where the ClientKey = 1000, if a Table/View/Stored Procedure has a ClientKey column, otherwise no effect.

    (This is to avoid having to specify which ClientKeys to hide in every Crystal Report or Stored Procedure)

    I'm fully prepared to hear this isn't possible -- but I feel it's definitely worth at least asking.

    Thank you for any assistance!

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Simply put - no, but not without exceptions. If you constructed every report based on stored procedures, then you can, with minor modifications to T-SQL code, accomplish what you need. I had to do something similar awhile back, so I created a 2 column table, and populated it with user id (standard or integrated - doesn't matter) and the value to be available for those few entries. Then for those queries that access tables where this type of value is present, I added an "...AND EXISTS(select * from exception_control_table where suser_sname() = exception_control_table.UserID and outside_table.KeyValue = exception_control_table.KeyValue)".
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    He could do it with views too, or even views within dedicated schemas that check the connection string to determine permissions.

    But isn't there a way to implement row-level security built into 2005/2008?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •