Filtering Records in Views

  • I have a set of views created from multiple transactional tables. Stored procedures use these views to present report to the user.

    Depending on the user the view would filter the records i.e. there is a function embeded in the view which finds out whether this user is allowed to see this record. This is achieved using "session" in temporary table (No userid (parameter) is passed to the stored procedure at all & this is done dynamically for that session by the function for the user logged in).

    I'm thinking whether this filtering function should be in the stored procedure or it should be in the view. Which is the best design solution?

  • May just be me, but I'd keep the filter in the stored procedure, unless the users also have access directly to view and not just using the stored procedure.

Viewing 2 posts - 1 through 1 (of 1 total)

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