Click here to Skip to main content
12,889,448 members (47,786 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL-server-2005 SQL-Server , +
Is there a way to have a column alias as a select clause, like in:
SELECT LoginName AS (SELECT AltCaption FROM Captions WHERE PK = 1000) FROM dbo.Users

Thanks in advance!
Posted 22-Nov-12 10:16am
Marcus Kramer 22-Nov-12 17:00pm
I think my initial question is Why would you feel the need to do that. I can't off the top of my head think of any practical reason for ever doing it.
Skippy II 22-Nov-12 17:05pm
I use the sql result in a gridlike control. Since the end users have different nationalities, I'm looking for a way to have captions in different languages.
Marcus Kramer 22-Nov-12 17:14pm
That should be handled by regionalization in your application, not your database. You could still store the regionalized column names in your database, but use a second query to the database to retrieve the display name for a column based on your static base column name.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I figured I would try and it doesn't appear that you can do this at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100