Re: Variable list of values in column
From: Roji. P. Thomas (lazydragon_at_nowhere.com)
Date: 02/22/04
- Next message: mark baekdal: "Query for dropped objects"
- Previous message: Ben Amada: "Re: reference a database in SP"
- In reply to: Kirk Graves: "Re: Variable list of values in column"
- Next in thread: Kirk Graves: "Re: Variable list of values in column"
- Reply: Kirk Graves: "Re: Variable list of values in column"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 22 Feb 2004 15:54:23 +0530
>>you are storing the same data repeatedly d)
>>people will laugh at you. :)
Even your design stores data repeatedly.
You have only reached 1NF.
--
Roji. P. Thomas
SQL Server Programmer
"Kirk Graves" <krgitsoftware@yahoo.com> wrote in message
news:%23Xw6VpL%23DHA.2324@tk2msftngp13.phx.gbl...
> The data structure you need would actually look like this
>
> Table: Project
> Fields: ProjectID
> Name
>
> Table: Supplier
> Fields: SupplierID
> Name
> ProjectID
>
> Table: Part
> Fields: PartID
> Name
> ProjectID
>
> using a comma delimeted list of values in a a field breaks the first rule
of
> normalization. this just means that a) searching is very difficult b)
> updating is very difficult c) you are storing the same data repeatedly d)
> people will laugh at you. :)
>
> Kirk Graves
> KRGIT Software
>
> "Cameron" <cam_banks@hotmail.com> wrote in message
> news:2cc8a69e.0402211154.7796dcf0@posting.google.com...
> > I've just started to work with databases for a project that requires
> > SQL Server, so I'm learning all of this as I design and develop the
> > application. Anyway I need to create a table that has the following
> > structure
> >
> >
> > Project
> > {
> > UniqueID
> > Name
> > List of suppilers
> > List of parts
> > }
> >
> > The two columns "List of suppilers" and "List of parts" are dynamic,
> > so for a given project it is desirable to add and remove "suppilers"
> > and "parts". It is also desirable to construct searches over projects
> > that contain a supplier or part.
> >
> > After some digging it would appear that the best way to store these
> > lists would be comma separated values. So the question I have is how
> > do I construct T-SQL searches and if a part or supplier is removed how
> > does I ensure the lists in the project table are updated.
> >
> >
> > Cheers
> >
> > Cameron
>
>
- Next message: mark baekdal: "Query for dropped objects"
- Previous message: Ben Amada: "Re: reference a database in SP"
- In reply to: Kirk Graves: "Re: Variable list of values in column"
- Next in thread: Kirk Graves: "Re: Variable list of values in column"
- Reply: Kirk Graves: "Re: Variable list of values in column"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|