Link to home
Start Free TrialLog in
Avatar of NUdovich2
NUdovich2

asked on

SQL table combine two numbers with a _ seperator. i.e. 600_400

I have a table with 2 int columns.

I want to create a third column that combines the two, but uses a _ or something as a seperator.
Would like to use the formula section in the computed column specification area

A        B         Needed Column
400     500     400_500
401     501     401_501
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to create the computed column try this

ALTER TABLE yourtablename ADD
C AS convert(varchar, ColA) + '_' + convert(varchar, ColB)