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)
 how to associate store procedure to table column

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 follows

CREATE PROCEDURE usp_Localisation_Lookup_Text (@strLanguage as varchar(15), @strEnglish as varchar(500))

AS

SELECT @strLanguage
FROM tblSystem_Localisation_MASTER
WHERE (English = @strEnglish)
GO

ok 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 Optimizer
TG
Go to Top of Page

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
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-05-05 : 11:26:29
follow the instructions in this link to provide us the necessary info to help you.
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx



Be One with the Optimizer
TG
Go to Top of Page

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]
GO

if 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]
GO

CREATE 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]
GO

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO



CREATE PROCEDURE usp_Localisation_Lookup_Text (@strLanguage as varchar(15), @strEnglish as varchar(500))

AS

SELECT Russian
FROM tblSystem_Localisation_MASTER
WHERE (English = @strEnglish)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO



finding out is better
Go to Top of Page
   

- Advertisement -