views:

21

answers:

2

Is there any way of adding custom text in an computed column?

For example this formula works great ([Duration] + '12')

Could i have a result, from a computed column, similar to this one?

([Duration] & ' MyCustomText')

Can i add custom text in a computed column? Or am i asking too much?

A: 

Sure, when you define a computed column, you can write any expression that the server can evaluate using the values in that table .. You just can't use column values from other tables...

Charles Bretana
+1  A: 

Yes, as long as you stick with correct T-SQl expresions:

(cast([Duration] as varchar(...)) + 'MyCustomText')
Remus Rusanu