Here is an example:
CREATE TABLE tbl (
idCol INT NOT NULL IDENTITY,
vcol1 VARCHAR(20) NOT NULL,
vcol2 VARCHAR(20) NOT NULL,
compcol AS LEFT(vcol1, 2) + CAST(idcol AS VARCHAR) + RIGHT(vcol2, 1));
If these are nullable columns, then you have to use ISNULL/COALESCE to
change the values to avoid string concatenation on NULLs.
--
Anith
>> Stay informed about: COLUMN FORMULA