Computed column should result to string

Posted by strakastroukas on Stack Overflow See other posts from Stack Overflow or by strakastroukas
Published on 2010-03-18T19:27:38Z Indexed on 2010/03/18 19:31 UTC
Read the original article Hit count: 269

Here is a snap of my database.

Both col1 and col2 are declared as int.

My ComputedColumn currently adds the Columns 1 and 2, as follows...

col1  col2  ComputedColumn
1     2     3
4     1     5

Instead of this, my ComputedColumn should join the columns 1 and 2 (includimg the '-' character in the middle) as follows...

col1  col2  ComputedColumn
1     2     1-2
4     1     4-1

So, what is the correct syntax?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sqlserver-2005