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