Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Update a View?

Author  Topic 

morphviper
Yak Posting Veteran

60 Posts

Posted - 2009-02-16 : 17:08:42
I am looking at a database and I am seeing several cases of stored procedures updating Views.. Is this a normal procedure in SQL 2000? I am also seeing nested views.
I have also seen Select statements from a view with an in (Select column from View).

Is all this normal?? or am I out of the loop?

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2009-02-16 : 17:36:11
By "updating views", if you mean that they are updating the data, nothing wrong with that. On the other hand, if you meant that they are updating the schema, I haven't seen very many cases of people routinely doing that. Nothing wrong with doing that, just seems a little unconventional. Does the task that is being carried out via the stored procedure genuinely require changing the schema?

Nested views are used very frequently in SQL 2000 to simply the logic and make the code more readable and maintainable. In SQL 2005, one can use common table expressions in many cases where nested views would have seemed convenient, so nested views may be less prevalent in SQL 2005, but there is nothing wrong with using them.
Go to Top of Page

morphviper
Yak Posting Veteran

60 Posts

Posted - 2009-02-16 : 17:42:44
No schemas are being updated.... Just data via and update statment to a view. I mainly work around 2005 DB and don't see this kind of code. I was trying to figure out the logic or if there where any benifits to it.

Go to Top of Page
   

- Advertisement -