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!

Are Views editable and auto updated?

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi All

My db is structured in such a way that the user is only ever editing records/tables relating to one of the 'master' ids. I'd like to set it up so that as soon as the user chooses which set of data to look at (ie, a 'master' id), I set the param in the appropriate views for that id and all the views are set up ready for the user, instead of querying the entire db everytime.

The user will want to edit the data, is this possible if retrieved from a view?

Also, an obvious question, is the view automatically updated if the data in it changes.

Now a really daft question, in theory, is there an instance of each view created for each individual user. So if 2 users want the same view but with 2 different ids passed to it, are 2 different views created?

big ta for any help/guidance
lou
p.s. sorry, using SQL server v7 (and I'm no expert)
 

Views can be updated as long as the records in the underying table(s) can be unambiguously identified.

Views are not physical entities like tables. A view is a virtual table whose contents are defined by a query and consists of a set of named columns and rows of data. However, a view does not exist as a stored set of data values in a database. The rows and columns of data come from tables referenced in the query defining the view and are produced dynamically when the view is referenced.

The scenario you describe is often referred to as row level security. Users are only allowed to view specified rows. Implementing row level security takes some planning and design. I answered a question about row level security recently in thread183-117888. Check it out and let me know if you have additional questions. Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it and comment if you have time.
NOTE: Reference to the FAQ is part of my signature and is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top