Home All Groups Group Topic Archive Search About

view in multi-users enviorment

Author
1 Sep 2005 12:44 PM
Sam
as a new imigrant from ms access to sql i have 1 basic question:

in multi-users enviorment when user1 use:
alter view AgeView
select * from tbl where age=30

and on the very same time user2 use:
alter view AgeView
select * from tbl where age=31

what is happaning?

in msaccess the query is local so every user get's his results
but in sql ????????

thanks

Author
1 Sep 2005 11:56 AM
Jens Süßmeyer
First come first serves. If they are changing the same procedure (with the
same owner that will be the result, if they own a view on their own, that´ll
be changed)

--
HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---


Show quote
"Sam" wrote:

> as a new imigrant from ms access to sql i have 1 basic question:
>
> in multi-users enviorment when user1 use:
> alter view AgeView
> select * from tbl where age=30
>
> and on the very same time user2 use:
> alter view AgeView
> select * from tbl where age=31
>
> what is happaning?
>
> in msaccess the query is local so every user get's his results
> but in sql ????????
>
> thanks
>
>
>
>
>
>
>
Author
1 Sep 2005 12:09 PM
David Portas
If two users alter the same view then then one will overwrite the
other's changes.

Views aren't intended as a mechanism to persist ad-hoc queries. Rather
they are part of your database schema and not something one would
expect regular users (non-developers) to alter.

The usual way to support parameterized queries is to create stored
procedures and route all those user-interactions through those procs.
If you need to support highly dynamic ad-hoc queries by users then you
may want to invest in some additional query building tool because SQL
Server doesn't have any mechanism to store queries in the database
other than by using procs or views. In principle each user could create
his or her own views but that may have some potentially undesirable
security and change management implications unless you have a quite
small community of users. There is a whole marketplace of BI tools to
address this need. In OLTP applications however, a high level of query
flexibility is mostly unneccessary - usually it's possible to
anticipate user's needs fully enough to create the necessary procs at
design-time.

--
David Portas
SQL Server MVP
--
Author
1 Sep 2005 12:26 PM
Dan Guzman
Rather than including the WHERE clause in your view, add a WHERE clause to
the query selecting from the view.  It's best to avoid DDL in client
applications.

    select * from AgeView where age=30

--
Hope this helps.

Dan Guzman
SQL Server MVP

Show quote
"Sam" <focu***@zahav.net.il> wrote in message
news:%23cf4BqurFHA.2596@TK2MSFTNGP09.phx.gbl...
> as a new imigrant from ms access to sql i have 1 basic question:
>
> in multi-users enviorment when user1 use:
> alter view AgeView
> select * from tbl where age=30
>
> and on the very same time user2 use:
> alter view AgeView
> select * from tbl where age=31
>
> what is happaning?
>
> in msaccess the query is local so every user get's his results
> but in sql ????????
>
> thanks
>
>
>
>
>
>

AddThis Social Bookmark Button