only thing I can think of is a dynamically-created SQL statement. Be aware that
this approach can introduce security vulnerabilities. I'm not sure about other
platforms, but this is how you would do it in SQL Server:
DECLARE @MyTitle varchar(20)
@MyTitle = '[My Builders]'
EXECUTE 'SELECT Builder_Name AS ' + @MyTitle + ' FROM
I would like to customize a column header by
specifying an alias in
a "Select" statement using a variable instead of
literal. My Select
statements error every time I try to use a
variable but work fine
using a literal...
For example, using a
literal everything works:
Select Builder_Name as [My Builders]
Fox and Jacobs
Using a declared variable to the
same value it errors:
Declare @mytitle char (11)
@mytitle = 'My Builders'
Select Builder_Name as @mytitle from
Server: Msg 170, Level 15, State 1, Line
Line 3: Incorrect syntax near '@mytitle'.
I have tried many
variations of the statement above and searched for
an internet example in
vain. I would be grateful for a solution
unsubscribe from this group, send an email
use of Yahoo! Groups is subject to the Yahoo! Terms of Service.