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)
 Multiple List Insert then query

Author  Topic 

joemama
Posting Yak Master

113 Posts

Posted - 2007-05-03 : 14:06:00
I have a form type "list" that I want to allow people the option of selecting more that one from the dropdown menu. It works fine and writes ID or ID's into the field as expected.

if one selection from the dropdown is selected it will write "5"
if multiple are selected it will write "5,32,2"

so far so good

but now i have to be able to query that field against another table to return the description of each

5 = arizona tech
5,32,2 = arizona tech,NYU,UCLA

is there a way to do it?

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-05-03 : 14:24:00
You need to normalize your database. You should never store delimited values like that in your data.

see: http://www.datamodel.org/NormalizationRules.html

also, see this:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=82447




- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

joemama
Posting Yak Master

113 Posts

Posted - 2007-05-03 : 14:50:30
Thanks

quote:
Originally posted by jsmith8858

You need to normalize your database. You should never store delimited values like that in your data.

see: http://www.datamodel.org/NormalizationRules.html

also, see this:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=82447




- Jeff
http://weblogs.sqlteam.com/JeffS


Go to Top of Page
   

- Advertisement -