Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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
Comments
Marcus Kramer at 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 at 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 at 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
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 625
1 CPallini 320
2 Sergey Alexandrovich Kryukov 305
3 BillWoodruff 269
4 Peter Leow 255


Advertise | Privacy | Mobile
Web01 | 2.8.141029.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2014
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