Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Users from Accessing Data

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
Is there a command or process that I can invoke that will keep users that are not DBOs from accessing any data on a SQL Server or database?

ProDev, Builders of Affordable Software Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Revoke db_datareader or db_owner permissions (or direct select permissions on tables), and access all data through stored procedures with parameters to select data to retrieve.
All you need to do is grant execute permissions on the stored procs and call them as appropriate from your application.

John
 
If you DENY permissions on an object, the deny takes precedence of a number of grants. If your users are not db_owners, it should prevent them from seeing it. I have not tested this through chain of ownership (i.e. a view on a denied table).
 
I decided to use the RESTRICTED_USER parm of the ALTER DATABASE COMMAND.

ProDev, Builders of Affordable Software Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top