Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is there a way to have a column alias as a select clause, like in:
SQL
SELECT LoginName AS (SELECT AltCaption FROM Captions WHERE PK = 1000) FROM dbo.Users

Thanks in advance!
Posted
Comments
fjdiewornncalwe 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.
fjdiewornncalwe 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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900