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.
| Author |
Topic |
|
amitshar131
Starting Member
2 Posts |
Posted - 2011-05-05 : 09:33:57
|
| I want to use same table for hindi and english version of website. can i do it. or i need to store different tables to store english and hindi equivalentsexampleitencode: 1itemname: vegetablesubitemname: carrotcan i use same table to display 1, sabji ( in hindi), gajjar ( in hindi)or i need to create a separate table and useitemcode:1itemname: sabjisubitemname: gajjar and use this table while selecting hindi as language of my website |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2011-05-05 : 09:55:29
|
You could have 2 tables or different columns in the same table, or you could try for 1st normal form. http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-05-05 : 10:16:14
|
| To avoid confusion: just create extra columns likeitem_code INT , item_ename VARCHAR(100), item_hname NVARCHAR(200),subitem_ename VARCHAR(100),subitem_hname NVARCHAR(200)--------------------------http://connectsql.blogspot.com/ |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2011-05-05 : 11:19:43
|
| It might be simple to add extra columns, but I think you'll be much happier if you actually normalize your data as Don has suggested. I also think it is easier to code against a normalized solution as opposed to adding extra columns. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2011-05-05 : 11:22:15
|
quote: Originally posted by Lamprey It might be simple to add extra columns, but I think you'll be much happier if you actually normalize your data as Don has suggested. I also think it is easier to code against a normalized solution as opposed to adding extra columns.
Especially if you later need to add another lanquage.CODO ERGO SUM |
 |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-05-05 : 11:51:05
|
| Amit,Just use one single table with a labelkey.you can have columns this way:labelkey, englishtxt,hinditxt etc.if you are using asp.net you can use hashtables(collections object) to populate the labels on the front end based on the choice of language. |
 |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2011-05-05 : 14:03:12
|
quote: Originally posted by Michael Valentine Jones
quote: Originally posted by Lamprey It might be simple to add extra columns, but I think you'll be much happier if you actually normalize your data as Don has suggested. I also think it is easier to code against a normalized solution as opposed to adding extra columns.
Especially if you later need to add another lanquage.CODO ERGO SUM
I think I'd vote for that one. Something like:ItemCodes---------ItemCode - PK - varcharOnOrder - numericOnHand - numericItemCodeDescriptions--------------------ItemCodeLangCode (Ex: English, Hindi, Punjabi)DescriptionAnd you could write your function:create function Translate(@ItemCode, @LangCode)asbegindeclare @x varchar(250)set @x = select Description from ItemCodeDescriptionswhere ItemCode = @ItemCode and LangCode = @LangCode)return @xend |
 |
|
|
|
|
|
|
|