Problem solve Get help with specific problems with your technologies, process and projects.

How do you implement data/row-level security in SQL Server 7.0 or 2000?

How do you implement data/row-level security in SQL Server 7.0 or 2000? I have a data warehouse with data from various organizations. I want to restrict organization data based on users logging into the SQL Server database via Crystal Enterprise 9.0 and Crystal Report Designer 9.0.

Microsoft provides a method to grant permisisons to individual columns within a table. Row-level security, however, is implemented using a "view", a stored proc, or SQL function. The method I most commonly see is using a SQL view--it's a lot easier than trying to manage column permissions. Instead, you grant SQL permissions to the view, not the underlying table. With creative use of a WHERE clause, you should only need one "view" for every type of database access. For example, a customer service rep viewing his/her trouble tickets can be accomplished by creating a view that filters the TroubleTicket database for tickets WHERE AgentName = SUSER_NAME(), a built-in SQL function that returns the currently logged-in username. This ensures that all actions taken using the view will only affect tickets for that agent. Deny permissions to all the tables and only grant your users permissions to the views. 

Step-by-Step Guide: How to patch SQL Server
This two-part series on SQL Server patch deployment will help you track down those pesky servers then walk you through patch deployment and the various options available to you.


Next Steps

Learn how to put row-level security to work in Azure SQL databases

Bringing row-level security to Azure SQL databases

Dig Deeper on SQL Server Security

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.