Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 which is better?

Author  Topic 

mariechristine
Starting Member

27 Posts

Posted - 2004-05-05 : 09:04:01
I have several entities for example: Order, Item, OrderITem, Country....
Each item can have many file path associated to it.
so which is better??
1-> For each entity, a table containing the file path and the entity it. Ex: FileID, OrderID, FilePath

2- or 1 table for all the entities in this way: FileID, FilePAth, EntityType (int: ex 1=Order, 2=Item..), RecordID

Later on I need to select the file paths for a certain entity. Which approach is better?

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-05 : 09:16:07
I would tend to go with 2 as it limits te number of tables you have to deal with.
Be prepared to create different tables if you have different requirements though.
Don't get caught up adding attributes to the table to try to make things fit that shouldn't.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -