Q:

Create additional unique ID based on three- different columns of the same table separated by '-' in SQL

I have a table with having 3 attributes, as listed below, I want to create additional column names as 'Special ID' which is based on Auth_Code, price & last 4 digit of card no. (these 3 combination will be separated by '-')
Card_No             Auth_Code   price
---------------------------------------
4439-....-....-9878 173275  13.00
4243-....-....-7537 016365  15.00
4214-....-....-0692 037406  36.00

how to make that happened?

A:

To create and initialize your new column, try this:
ALTER TABLE yourtable ADD SpecialID varchar(200)

UPDATE yourtable 
set SpecialID = 
     auth_code + '-' + price + '-' + substring(card_no, len(card_no) - 4, len(card_no))
WHERE SpecialID is null

