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)
 correct way of storing data

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-11-28 : 09:11:45
1)i need to store a report order,in which the user choosed some options (from a group of check boxes) and to save this selection.
the thing is that i can define a table like this :
orderid,userid,type1,type1,type3....
but i dont want to manage the types so if i add a type i need to go to the table and add it there(a new colum of "typeX"!
so what the best way to manage it?
2)a question about giving coluns a name
if i have a client,and the client make queryies about his client in my DB which name do i give as the column name of my clinetID and which for his(myclient) clientid?
thnaks in adbvance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-11-28 : 09:24:16
1.
store it in a table.
create table (orderid, userid, columnName, orderNumber)
and then insert data with proper order numbers
2.
client_id is column. you'll probably need another column named parent_client_id which points to the client_id
a standart hierarchical relationship.


if that doesn't work for you post more info on what you exactly need.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

pootle_flump

1064 Posts

Posted - 2006-11-28 : 10:12:33
quote:
Originally posted by pelegk2

i can define a table like this :
orderid,userid,type1,type1,type3....
but i dont want to manage the types so if i add a type i need to go to the table and add it there(a new colum of "typeX"!
Yes yes yes! You have a chance to put together a normalised structure where you won't have the same headaches you have had with the denormalised mess you inherited.

http://r937.com/relational.html
Go to Top of Page
   

- Advertisement -