Re: Help with Stored proceedure
From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 09/25/04
- Next message: David Portas: "Re: Paging through large sql server tables"
- Previous message: Kan Grewal: "Re: Insert Query taking ages...."
- In reply to: anonymous_at_discussions.microsoft.com: "Re: Help with Stored proceedure"
- Next in thread: sqlhelp_at_comtrackuk.co.uk: "Re: Help with Stored proceedure"
- Reply: sqlhelp_at_comtrackuk.co.uk: "Re: Help with Stored proceedure"
- Messages sorted by: [ date ] [ thread ]
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 --
- Next message: David Portas: "Re: Paging through large sql server tables"
- Previous message: Kan Grewal: "Re: Insert Query taking ages...."
- In reply to: anonymous_at_discussions.microsoft.com: "Re: Help with Stored proceedure"
- Next in thread: sqlhelp_at_comtrackuk.co.uk: "Re: Help with Stored proceedure"
- Reply: sqlhelp_at_comtrackuk.co.uk: "Re: Help with Stored proceedure"
- Messages sorted by: [ date ] [ thread ]