Wednesday, March 7, 2012

Does anyone use views?

Good Morning,
Does anyone have any use for views? I know how to build them, but i cant
find any use for them.
They are supposed to protected the data, protect how? does the users have
access to all the data if i dont use views? should i allways access views
insted of the tables to protected the data?
Thanks,
Bruno Nhttp://www.aspfaq.com/2537
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Bruno N" <nylren@.hotmail.com> wrote in message
news:uKqcCWpPFHA.248@.TK2MSFTNGP15.phx.gbl...
> Good Morning,
> Does anyone have any use for views? I know how to build them, but i cant
> find any use for them.
> They are supposed to protected the data, protect how? does the users have
> access to all the data if i dont use views? should i allways access views
> insted of the tables to protected the data?
> Thanks,
> Bruno N
>|||Thank you ! :)
"Bruno N" <nylren@.hotmail.com> escreveu na mensagem
news:uKqcCWpPFHA.248@.TK2MSFTNGP15.phx.gbl...
> Good Morning,
> Does anyone have any use for views? I know how to build them, but i cant
> find any use for them.
> They are supposed to protected the data, protect how? does the users have
> access to all the data if i dont use views? should i allways access views
> insted of the tables to protected the data?
> Thanks,
> Bruno N
>|||To add to Aaron's response, another reason to use views and procs instead of
direct access to the underlying tables is that it provides a well-defined
application interface. As long as you don't change the interface, you can
freely modify table schema without changing application code.
Hope this helps.
Dan Guzman
SQL Server MVP
"Bruno N" <nylren@.hotmail.com> wrote in message
news:uKqcCWpPFHA.248@.TK2MSFTNGP15.phx.gbl...
> Good Morning,
> Does anyone have any use for views? I know how to build them, but i cant
> find any use for them.
> They are supposed to protected the data, protect how? does the users have
> access to all the data if i dont use views? should i allways access views
> insted of the tables to protected the data?
> Thanks,
> Bruno N
>|||Of course you should use them and not just because of security but for bette
r
performance too. This is a long story so I’ll give you some ref links to h
elp
you (my fingers hurts me already...this way typing day :))
http://www.microsoft.com/resources/... />
c3661.mspx
http://www.sqlteam.com/item.asp?ItemID=1015
http://www.sql-server-performance.com/indexed_views.asp
I couldn't find any article that exclusively focuses only on views and
security.
But I'll try to give you and idea with this example:
You have table Orders (OrderID int, CustomerID int,) which contains all
orders of your company.
You want to allow to group of users "A" to select, update and delete only
orders of Customer "C1" (CustomerID=1) and to group "B" only orders of
Customer "C2" (CustomerID=2) .
And, of course, at the same time you may deny all these privileges directly
on table Orders for both groups (A and B).
One of possible solutions (and recommended one) is two create 2 separate
Views: One which will display only orders of Customer "C1" (where
CustomerID=1) and other one which will display only orders of Customer "C2"
(where CustomerID=2) and on both views grant select, update, delete to its
respective groups (A->C1, B->C-2).
Hope this help.
Regards,
Marko Simic
"Bruno N" wrote:

> Good Morning,
> Does anyone have any use for views? I know how to build them, but i cant
> find any use for them.
> They are supposed to protected the data, protect how? does the users have
> access to all the data if i dont use views? should i allways access views
> insted of the tables to protected the data?
> Thanks,
> Bruno N
>
>|||Thank you all that helped me out!
Im gonna read them right now!
"Bruno N" <nylren@.hotmail.com> escreveu na mensagem
news:uKqcCWpPFHA.248@.TK2MSFTNGP15.phx.gbl...
> Good Morning,
> Does anyone have any use for views? I know how to build them, but i cant
> find any use for them.
> They are supposed to protected the data, protect how? does the users have
> access to all the data if i dont use views? should i allways access views
> insted of the tables to protected the data?
> Thanks,
> Bruno N
>

No comments:

Post a Comment