📜  带有前缀 sql 代码示例的主键

📅  最后修改于: 2022-03-11 15:05:35.087000             🧑  作者: Mango

代码示例1
create table  #test
(
Id int identity(1,1),
Pid as 'PRE-'+REPLACE(STR(id, 7), SPACE(1), '0')
)
 
INSERT INTO #test DEFAULT VALUES
INSERT INTO #test DEFAULT VALUES
select *From #test