Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modeling an object in a SQL table

Status
Not open for further replies.

Florin

Programmer
Joined
Sep 13, 2001
Messages
1
Location
RO
I’m beginner in the SQL programming and I have the following problem:

I have to design a table (or more) in order to put there an old object that was stored before in files (OBJECT). It has ID, name, description, etc. and 4 fields of type char (unknown size – I put them of type “Text” in SQL) and two fields of SQL type “Text” with the results of this object (this object can return a result and the current and the previous results have to be stored).

How is the best design for this object?
OBJECT( nID, nUserID, name, description, Text1, Text2, Text3, Text4, Text5, Text6, etc.) in one table.
This table can have very variable number of records. It can have 100 records or it can have above 1mil.

OR

OBJECT( nID, nUserID, name, description, etc.) – The columns which have a fix size.
ExtraObject( nID, Text1, Text2, Text3) – I don’t need them at every OBJECT table scan, but ~70% - 80% I need them
ResultsObject( nID, Text1, Text2 ) – I don’t need them at OBJECT scanning, just as a separately request for object X.

Thanks.
 
In the situation you have described I would always choose your second example.

Rick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top