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 |
Ciwan21
Starting Member
7 Posts |
Posted - 2009-04-29 : 11:08:26
|
hi there,can anyone help me on this please??????i have a store procedure as it followsCREATE PROCEDURE usp_Localisation_Lookup_Text (@strLanguage as varchar(15), @strEnglish as varchar(500)) ASSELECT @strLanguageFROM tblSystem_Localisation_MASTERWHERE (English = @strEnglish)GOok here is the question. How can i associate in that tblSystem_Localisation_MASTER to this store procedure with the column instead of saying @strLanguage? i want to say "pick column 2" which could be finnish or danish or any other language in tblSystem_Localisation_MASTER columns. (column 1 is english, column 2 is finnish column 3 khmer and they are all translated already)so basically i want the store procedure to pick up the number instead of i say name.I dont know if its possible?Can anyone help me out.I'll be appreciated!finding out is better |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-04-29 : 11:42:53
|
Instead of having a column for each language you should have a row for each language and include a column to specifiy which language that row is. Then you can say: select languageString from <yourTable> where language = 'Russian'Be One with the OptimizerTG |
|
|
Ciwan21
Starting Member
7 Posts |
Posted - 2009-05-05 : 07:22:56
|
i dont really know how to do it :( i started on this project while it was done already! and im very new to Sql server. if you be more specific and helpful on the codes i'd be really appreciated. Thanks very much in advance i may receive any other help.finding out is better |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
|
Ciwan21
Starting Member
7 Posts |
Posted - 2009-05-07 : 05:22:50
|
thanks man. there is the code of the master table where i wanna get the info from and also Store procedure.if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_Localisation_Lookup_Text]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)drop procedure [dbo].[usp_Localisation_Lookup_Text]GOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tblSystem_Localisation_MASTER]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[tblSystem_Localisation_MASTER]GOCREATE TABLE [dbo].[tblSystem_Localisation_MASTER] ( [English] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Active] [bit] NULL , [New] [bit] NULL , [Finnish] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [French] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Russian] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Spanish] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [German] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Khmer] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Korean] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Hungarian] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Arabic] [nvarchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY]GOSET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS OFF GOCREATE PROCEDURE usp_Localisation_Lookup_Text (@strLanguage as varchar(15), @strEnglish as varchar(500)) ASSELECT RussianFROM tblSystem_Localisation_MASTERWHERE (English = @strEnglish)GOSET QUOTED_IDENTIFIER OFF GOSET ANSI_NULLS ON GOfinding out is better |
|
|
|
|
|
|
|