Manipulating users' rights at row level in SQL Server 2005
In SQL Server 2005, I need to manipulate users' rights at row level. So far, I'm thinking of making a view according to users' needs, and grant permissions on the view. Is there any other possibility in SQL Server 2005?

    Requires Free Membership to View

    When you register, you’ll also receive targeted emails from my team of award-winning editorial writers.  Our goal is to keep you informed on the hottest topics and biggest challenges faced by today's SQL Server database pros.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSQLServer.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSQLServer.com is governed by our Terms of Use. You may contact us at [email protected].

As a quick solution, you may have the table in which you ultimately access have an additional character that can be the user login name. Have users select from a view that in turn selects from this table with the following filter: (where clause) where UserLoginName = suser_sname()

This will filter out only that particular user's data. If you want to get more complex, Microsoft has an excellent white paper Implementing Row-and-Cell-Level Security in Classified Databases Using SQL Server 2005 that uses custom database roles to accomplish the same.

This was first published in June 2006