Re: Help with Stored proceedure

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 09/25/04


Date: Sat, 25 Sep 2004 12:57:01 +0100

You can try this:

CREATE PROCEDURE usp_languagewords
 (@langid INTEGER)
 AS
 SELECT
  (SELECT word
   FROM languagewords
   WHERE langid = @langid
    AND variname = 'strlabel1') AS strlabel1,
  (SELECT word
   FROM languagewords
   WHERE langid = @langid
    AND variname = 'strlabel2') AS strlabel2,
  (SELECT word
   FROM languagewords
   WHERE langid = @langid
    AND variname = 'strlabel3') AS strlabel3
... etc

I'm assuming that (langid, variname) is unique in languagewords. If this
still isn't what you want then it would help if you could post DDL (a CREATE
TABLE statement for the table, including keys and constraints), some sample
data (best include this as INSERT statements) and show your required end
result.

-- 
David Portas
SQL Server MVP
--