Reply to Re: Mini Index?

Your name:

Reply:


Posted by Erland Sommarskog on 12/06/05 00:27

(paulmac106@gmail.com) writes:
> I tried a computed column, but then all the users of the windows
> application that is the front end of this database got errors when
> trying to insert a record into this table. Is there anything more I
> have to do to use a computed column?

Sounds like a case of poor application design.

An alternative is to use an indexed view instead. The view would look
like:

CREATE VIEW showed_view WITH SCHEMABINDING AS
SELECT pkcol
FROM tbl
WHERE yourcolumn = 'Showed'

You would then have to use this view in your queries. (In theory SQL Server
could use the view even if you query the table directly, but it does not
always happen.)

--
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

[Back to original 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

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