| Author |
Topic |
|
cutepraba
Yak Posting Veteran
53 Posts |
Posted - 2008-07-16 : 11:06:55
|
| Dear All,I need to create a table that contains path of image file name and their relavant tags(i.e related to nature, people, wallpaper etc). User will input their values with space separated. Can anyone please give me the best idea to design the table so that i can easily call the images with tags in my asp pages.Thanks in advance.____________Praba |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-16 : 11:10:12
|
Use CROSS APPLY if using SQL Server 2005. If not using SQL Server 2005, use a scalar valued function. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
cutepraba
Yak Posting Veteran
53 Posts |
Posted - 2008-07-16 : 11:22:18
|
| I am very new to sql server, can you please paste the sample table with design view.I am using sql server 8.____________Praba |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-07-16 : 11:33:02
|
| You need 3 tables:A table of TAGSA table of IMAGESAnd a table that relates TAGS to IMAGESSomething like this:TAGS (TagName)IMAGES (ImageID, ImagePath, Description, etc ...)IMAGETAGS (ImageID, TagName)- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
cutepraba
Yak Posting Veteran
53 Posts |
Posted - 2008-07-16 : 11:46:34
|
| So the IMAGETAGS table contains (ImageID, TagName)Tagid Tagname1 nature wallpaper photoshop2 nature flash photoshop3 nature sqlserver photoshop4 nature personal photoshopLater i will call with like command?____________Praba |
 |
|
|
cutepraba
Yak Posting Veteran
53 Posts |
Posted - 2008-07-16 : 11:47:28
|
| If the user click the "photoshop" it will fetch the images with tags "photoshop".____________Praba |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-07-16 : 12:06:19
|
quote: Originally posted by cutepraba So the IMAGETAGS table contains (ImageID, TagName)Tagid Tagname1 nature wallpaper photoshop2 nature flash photoshop3 nature sqlserver photoshop4 nature personal photoshopLater i will call with like command?____________Praba
No. Each row in the tag table should be a single tag. That is, the list should be:natureflashsqlserverpersonalphotoshop..etc ...Right? each tag row = one single tag. Then, if picture #2 is tagged with "personal" and "photoshop", then your IMAGETAGS table would be:PictureID, TagName2,personal2,photoshopNotice that pictureID #2 is associated with 2 tags, one per row. You can add/remove tags for this picture easily by adding or removing rows from this table. A single column in a single row should never have more than 1 piece of information on it. By designing your system this way, you can have as many tags as you want,and each image can have as many tags as you want.- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
cutepraba
Yak Posting Veteran
53 Posts |
Posted - 2008-07-16 : 12:29:29
|
| Which way is fastest.each tag row = one single tagmultiple tags in one singel field?Because i will use my tables in asp pages.____________Praba |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
|