Question : Re-use generated field in MS SQL Server?

On Microsoft SQL Server 2008, I want to select like this:

1:
2:
3:
Select
Field1 = Convert(VarChar(25), 'MyString'),
Field2 = Field1


However that generates the error:
Msg 207, Level 16, State 1, Line 3
Invalid column name 'Field1'.

For several views I'm writing, multiple modified/generated fields are instanced multiple times, and I'd like to avoid re-writing the same field generation/modification code.

Thanks!

Answer : Re-use generated field in MS SQL Server?

Random Solutions  
 
programming4us programming4us