By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE #Demo
(
[Tag Type] char(1) NOT NULL,
[Parent Tag Type] char(1) NULL,
[Tag Area No] integer NOT NULL,
[Tag seq No] integer NOT NULL,
[Tag Suffix] char(1) NULL,
[Tag] AS CONCAT([Tag Type], [Parent Tag Type], [Tag Area No], [Tag seq No], [Tag Suffix])
);
INSERT #Demo
([Tag Type], [Parent Tag Type], [Tag Area No], [Tag seq No], [Tag Suffix])
VALUES
('T', NULL, 1234, 1, NULL),
('T', 'P', 5678, 1, 'S');
2 rows affected
SELECT * FROM #Demo AS D;
Tag Type | Parent Tag Type | Tag Area No | Tag seq No | Tag Suffix | Tag |
---|---|---|---|---|---|
T | null | 1234 | 1 | null | T12341 |
T | P | 5678 | 1 | S | TP56781S |