You are here: Re: Update question « MsSQL Server « IT news, forums, messages
Re: Update question

Posted by Erland Sommarskog on 05/22/05 19:13

akej via SQLMonster.com (forum@SQLMonster.com) writes:
> OK thanks, maybe, however what does it mean
>>turn the column into rows.
>

Instead of having:

CREATE TABLE xyx (object_id int NOT NULL PRIMARY KEY,
thisproperty bit NOT NULL,
thatproperty bit NOT NULL,
...


You have

CREATE TABLE xyz_properties (object_id int,
property_code varchar(5),
value bit,
CONSTRAINT pk_xyx_prop PRIMARY KEY (object_id, property_code),
CONSTRAINT fk_xyz_objid FORIEGN KEY (object_id)
REFERENCES xyz(object_id),
CONSTRAINT fk_xyz_property FORIEGN KEY (property_code)
REFERENCES property_codes(property_code))

This table property_codes would be one you loaded once for all when
you install the system.



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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 

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

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