Saving multiple items per single database cell...
Posted
by eugeneK
on Stack Overflow
See other posts from Stack Overflow
or by eugeneK
Published on 2010-05-13T09:45:54Z
Indexed on
2010/05/13
9:54 UTC
Read the original article
Hit count: 254
Hi, i have a countries list. Each user can check multiple countries. Once saved, this "user country list" will be used to get whether other users fit into countries certain user chose.
Question is what would be the most efficient approach to this problem...
I have one, one to save user selection as delimited list like Canada,USA,France ... in single varchar(max) field but problem with it would be that once user from Germany enters page i perform this check on. To search for Germany i would be needed to get all items and un-delimit each field to check against value or to use sql 'like' which again is pretty damn slow..
If you have better solution or some tips i would be glad to hear.
Just to make sure, many users will have their own selections of countries from which and only they want to have users to land on their page. While millions of users will reach those pages. So the faster approach will be the better.
technology, MSSQL and ASP.NET
thanks
© Stack Overflow or respective owner