You are here: Re: select * in views « MsSQL Server « IT news, forums, messages
Re: select * in views

Posted by Erland Sommarskog on 10/02/17 11:45

Alexander Kuznetsov (AK_TIREDOFSPAM@hotmail.COM) writes:
> I think one more scenario for select * views is when a view is used as
> a security tool. Suppose I expose a whole table to a user
>
> grant select on sales to johnsmith
>
> If later on I add a column to sales table, it is visible to johnsmith.
> Suppose I expose to danbrown only his own sales via a view:
> create view persons_own_sales
> as
> select * from sales where ...
>
> grant select on persons_own_sales to danbrown
>
> Again, If later on I add a column to sales table, I want it to be
> visible to danbrown with minimum maintenance - just refresh the view.
> Makes sense?

Yes, I think that I mentioned this in previous post in the thread.

Then again, it may be the case that you don't want to expose the
columns that controls access.

Also, in this case, the maintenance problem is smaller as there is
on one SELECT on the view. (I'm assuming the view has something like
WHERE user = SYSTEM_USER.) With a partitioned view, you have a
repetition with more room for errors.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация