Hiding tables from users

  • Hello,

    I have a database that I want users to be able to connect to in order to run some simple reports; but I don't want them to see the entire database structure. I have defined a View that contains all of the data that the users will need to view, and I would like to hide everything from them but this one view.

    Is there any easy way to accomplish this?

  • Grant the users select on that view and no other permissions. With that all they'll be able to do is see and query the view.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the response! I've tried this but I'm still getting a boat load of stored procedures from the 'sys' schema. Is there any way to hide those?

  • Not without potentially breaking things. Those are system procedures.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Agree with Gail, nothing you can do there without potentially causing lots of issues.

    Just grant rights to the view. Most of the system procedures will be uninteresting to them after they run them once or twice.

  • And the system procedures won't show them things that they don't have permission on. So they can't use a system procedure to see the definition of a table that they have no ability to see.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply