Syntax to auto generate column code which was contains string values

  Kiến thức lập trình
CREATE TABLE test_zz (
    id INT IDENTITY(1,1) PRIMARY KEY,
    customid AS 'ABC' + RIGHT('01' + CAST(id AS VARCHAR(150)), 2),
    test_column VARCHAR(100)
);

insert into test_zz (test_column)
values
('Sample 2');

select *
from test_zz;

I want generate code automatically when I want fetch the data

New contributor

mahesh kopparthi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

LEAVE A COMMENT